Show or Hide soft keyboard on opening a dialog or activity in android
For showing the soft keyboard on entering into the activity or to the dialog we can use this coding
Java
and for hiding the keyboard
Java
Have a nice day!
Java
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);
and for hiding the keyboard
Java
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(singleedittext.getWindowToken(),0);
Have a nice day!
No comments:
Post a Comment