Show immediately the keyboard in a new view
Possible Duplicate:
Close/hide the Android Soft Keyboard
I have a problem with the visibility of the keyboard in a view: I have an activity with its own view (layout) that contains a button "new". Clicking on the button is superimposed on a view (layout) with a transparent background and an EditText.
My question is:
I would like to bring up the keyboard immediately when I click on "new" and the new screen appears, I click on that new, new screen appears with the keyboard and click on the EditText without sull'edittext to bring up the keyboard. I hope I explained. How can I do?
您应该将以下行添加到AndroidManifest.xml中的活动中:
android:windowSoftInputMode="stateAlwaysVisible"
Programatically:
edittext.requestFocus();
Through xml:
<EditText...>
<requestFocus />
</EditText>
either will set the focus on the your edittext at the beginning and as such will bring up your keyboard.
链接地址: http://www.djcxy.com/p/16618.html上一篇: 在Android中隐藏键盘
下一篇: 在新视图中立即显示键盘