Hide Keyboard : Key « User Event « Android






Hide Keyboard

    

import android.content.Context;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;

class Main {
  public static void hideKeyboard(Context context, EditText input)
  {
    InputMethodManager imm = (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.hideSoftInputFromWindow(input.getWindowToken(), 0);
  }

}

   
    
    
    
  








Related examples in the same category

1.Key event listener
2.Example of writing an input method for a soft keyboard.
3.Soft keyboard get Char
4.show hide virtual keyboard
5.has Physical Keyboard
6.Show Keyboard
7.intrepret Direction Key