I want to show the soft keyboard for Android to load the page and programmatically focus the input field.
$('#field').focus();
As far as I’ve researched, this is impossible to do, except for events created by the user, such as the click event.
So, I tried a workaround to focus the input field and show the Android keyboard manually using this code.
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInputFromWindow(myWebView.getWindowToken() , InputMethodManager.SHOW_IMPLICIT , 0);
The keyboard is displayed successfully, and the input field also focuses. But the problem is that it only shows a standard keyboard. I want to show the keyboard according to the specified input type.
As if the input field:
<input type="number" id="field" name="field"/>
A standard text keyboard is displayed above the workaround, but I want to show the numeric keypad according to the type in the input field.