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
Code Snippet:
and for hiding the keyboard
Code Snippet:
Enjoy!!!!!!!!!!!
For showing the soft keyboard on entering into the activity or to the dialog we can use this coding
Code Snippet:
1 2 | InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0); |
and for hiding the keyboard
Code Snippet:
1 2 | InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(singleedittext.getWindowToken(),0); |
Enjoy!!!!!!!!!!!
No comments:
Post a Comment