Is it possible to popup virtual keyboard when some command is being received from server? I am trying to call focus on text area but soft keyboard is not coming. I agree that for keyboard to popup, user event is required. Is there any way to show virtual keyboard forcefully? I am talking about web app inside Android chrome browser.
Asked
Active
Viewed 4,086 times
2
-
http://stackoverflow.com/questions/5593053/open-soft-keyboard-programmatically – Niko Mar 06 '13 at 09:53
-
Are you talking about a native app or a web app inside Android browser ? – sdabet Mar 06 '13 at 09:53
-
1@fiddler: a web app inside Android browser – user1659302 Mar 06 '13 at 10:20
3 Answers
2
You can do this by calling focus()
then click()
on the input, but, as you say, only when the script is initiated by user input. My current answer, having spent a day fiddling, is that there is no way to get around this.

bbsimonbb
- 27,056
- 15
- 80
- 110
-
Thanks, "calling `focus()` then `click()` on the input" was precisely what I was looking for and it worked. – Dário Mar 17 '18 at 01:45
0
This question may help you: Showing Android's soft keyboard when a field is .focus()'d using javascript
In your case you could try to have a hidden text input field on your page and trigger a click event on it when the command is received from the server.
-1
EditText editText = (EditText) findViewById(R.id.myEdit);
InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
// only will trigger it if no physical keyboard is open
mgr.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT);
May this will help you

Dinesh Prajapati
- 9,274
- 5
- 30
- 47