开发者

How to enable on-screen keyboard?

开发者 https://www.devze.com 2023-01-17 21:53 出处:网络
I have one screen. it consists of an edit text. I want when this screen shownon the screen, keypad automatically shown by开发者_如何学JAVA default without clicking on the edit text.Have you tried some

I have one screen. it consists of an edit text. I want when this screen shown on the screen, keypad automatically shown by开发者_如何学JAVA default without clicking on the edit text.


Have you tried something like:

InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInputFromInputMethod(myEditText.getWindowToken(), 0);


In your App Manifest.xml file, you can set the soft keyboard status. Sounds like you want to set it to "stateVisible" or "stateAlwaysVisible"

android:windowSoftInputMode=["stateUnspecified",
                                   "stateUnchanged", "stateHidden",
                                   "stateAlwaysHidden", "stateVisible",
                                   "stateAlwaysVisible", "adjustUnspecified",
                                   "adjustResize", "adjustPan"] > 
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号