键盘在方向更改时隐藏
答
试试这个:
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInputFromWindow(enterChat.getWindowToken(), 0);
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
这会让你的键盘总是可见。在这个enterchat是我使用过的editText
。你不需要我想的那件事。
答
添加这对你的代码
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
答
你好你可以试试AndroidManifest.xml中
android:windowSoftInputMode="stateAlwaysVisible"
把这个。在类文件
答
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
把这个的onCreate()和的onResume()。
我已经在我的清单,但它不工作.. :( – CMA 2011-05-17 07:41:09