How can I detect that the telephone does not have hardware keyboard and only in that case to force showing the virtual one? And how can I hide it?
I tried putting the focus like this but it doesn't work:
View exampleView = (View)findViewById(R.id.exampleBox);
exampleView.requestFocus();
If I force like this the virtual keyboard, the keyboard will appear also when a hardware keyboard is available, which doesn't make sense.
InputMethodManager inputMgr = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
inputMgr.toggleSoftInput(0, 0);
And last but not least, how can I show directly the numerical or phone keyboard? (Not the normal keyboard)
Any idea?
Thanks!
I would say use the Configuration class hardKeyboardHidden to see if the hard keyboard is out and if not then open the soft keyboard
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With