3

I am developing an application where I have RFID reader (emulates keyboard). In some activities I need a virtual keyboard as well. I have discovered that all I need is to toggle "Use Physical Keyboard". That works fine, but when I restart my tablet, this feature is set to default?

Is it possible, if I can insert a toggle somewhere in my code?

homework
  • 4,987
  • 11
  • 40
  • 50
Mihael Meklav
  • 335
  • 2
  • 6
  • 17

1 Answers1

1

I was able to toggle the on-screen keyboard, with the following code:

InputMethodManager inputMgr = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
inputMgr.toggleSoftInput(0, 0);

In reference, use EditText.

"EditText is a thin veneer over TextView that configures itself to be editable."

To display the on-screen keyboard, all they need do is touch in the textbox. If that box was named "Search" or something similar, I believe it would be more useful to a user than a button.

homework
  • 4,987
  • 11
  • 40
  • 50