Android的EditText无法自动弹出输入法问题 .

方法1:

/**
 * 显示键盘
 * 
 * @param context
 * @param view
 */
public static void showInputMethod(Context context, View view) {
InputMethodManager im = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
im.showSoftInput(view, 0);
}

 

 

方法2:

给activity配置加入android:windowSoftInputMode="adjustResize"。

问题解决。

 

 

解决方法3.:

调用代码:

//自动弹出键盘
InputMethodManager inputManager = (InputMethodManager) getApplication().getSystemService(Context.INPUT_METHOD_SERVICE);
inputManager.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);

使用handler延时。

问题解决。

如果直接在oncreate()中调用,没有进行延时,输入法还是无法弹出。

posted @ 2013-05-31 15:47  阳光穿透泛白的记忆  阅读(550)  评论(0编辑  收藏  举报