Android show digits keypad on activity start
As stated in the title, how do I call the digits keypad on activity start? Right now I have this:
InputMethodManager imm = (InputMethodManager)getSystemServ开发者_Python百科ice(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
in OnCreate. But this is just a normal full keyboard with letters.
this was my aproach.
To show it
InputMethodManager lIMManager
lIMManager = (InputMethodManager) getSystemService(this.INPUT_METHOD_SERVICE);
lIMManager.getInputMethodList();
lIMManager.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
To hide it
mIMManager.hideSoftInputFromWindow(txtPin.getWindowToken(), 0);
The down side is that you have to close it by hand( it wont even close if you close the app) Hope this helps! Regards
精彩评论