Hide android keyboard programmatically

To hide the keyboard view programmatically, call this function

public static void hideKeyboard(Context context, View view){
    InputMethodManager imm = (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
}


Also published on Medium.

By |2019-04-05T09:42:36+00:00March 14th, 2019|Categories: Android Tips|Tags: |0 Comments

Leave A Comment