Android中DialogFragment自动弹出输入法

  1. 只需要添加
    1.  editTextPassword.setFocusable(true);  
    2.         editTextPassword.setFocusableInTouchMode(true);  
    3.         editTextPassword.requestFocus();  
    和在onresume()方法里面定义键盘弹出的时间
    1. @Override  
    2.     public void onResume() {  
    3.         super.onResume();  
    4.         log.info("onResume");  
    5.         (new Handler()).postDelayed(new Runnable() {  
    6.             public void run() {  
    7.                 log.info("postDelayed");  
    8.                 InputMethodManager inManager = (InputMethodManager)editTextPassword.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);  
    9.                 inManager.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);  
    10.             }  
    11.             },500);  
    12.     }  

你可能感兴趣的:(Android中DialogFragment自动弹出输入法)