Friday, October 26, 2012

Programatically Hide/Show Android Soft Keyboard

InputMethodManager imm = (InputMethodManager)getSystemService(Service.INPUT_METHOD_SERVICE);
for hide keyboard
 imm.hideSoftInputFromWindow(ed.getWindowToken(), 0); 
for show keyboard
 imm.showSoftInput(ed, 0);
for focus on EditText
 ed.requestFocus();

Changes in Menifest.xml

<activity android:name=".Activity" android:configChanges="keyboard|orientation"></activity>
 
 For more information check this Question

No comments: