views:

1590

answers:

2

dear friends,

i have a textbox and button aligned to parent bottom.

when i enter text in it and press button to save data. keyboard does not disappear.

can any one guide me how to disappear keyboard?

any help would be appriciated

+3  A: 

This should work.

  InputMethodManager inputManager = (InputMethodManager) Context.getSystemService(Context.INPUT_METHOD_SERVICE); 
  inputManager.hideSoftInputFromWindow(this.getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); 
Eclipsed4utoo
getting following error oncreate Cannot make a static reference to the non-static method getSystemService(String) from the type
UMMA
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0); working now...
UMMA
A: 

Hello i have a relativeLayout at the top, then below i have a listView in the center and finaly at the bottom i have other relativeLayout with an editText and a button inside. I want to the listview resize when click the editText and the IME(virtual keyboard) appear. If i put adjustResize in the manifest, the listview is resized to leave space for the IME, but the relativeLayout with the editText that is below is cover by the IME and i can't see what i am writing. If i put adjustPan, the keyboard push up all, the listview is not resized and i loose the top relativeLayout. D: PLEASE HELP!!!!

Luciano
post new quetion by pressing "Ask Question" along with your code in order to get correct answer at appropriate place.
UMMA