开发者

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

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜