How To Open Keyboard On Button Click In Android?
How can I open Keyboard on Button click in android? What I want to be like this:
Solution 1:
Please try this
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);
Solution 2:
InputMethodManager imm = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(view, flags)
an example may be:
InputMethodManager imm = (InputMethodManager) RouteMapActivity.this
.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(mapView, InputMethodManager.SHOW_IMPLICIT);
Solution 3:
Write this code inside the Button click event to TOGGLE the keyboard:
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);
Post a Comment for "How To Open Keyboard On Button Click In Android?"