Hello. There are 2 editText. When you open DrawerLayout, the keyboard does not hide. How can this issue be resolved? (When pressed into another revenge, you can not hide it).

  • If you are given an exhaustive answer, mark it as correct (a daw opposite the selected answer). - Nicolas Chabanovsky

1 answer 1

When you open the side menu, you can hide the keyboard as follows:

private DrawerLayout mDrawerLayout; ... mDrawerLayout.addDrawerListener(new DrawerLayout.DrawerListener() { @Override public void onDrawerSlide(View drawerView, float slideOffset) { InputMethodManager inputMethodManager = (InputMethodManager) YourActivity.this.getSystemService(Activity.INPUT_METHOD_SERVICE); inputMethodManager.hideSoftInputFromWindow(YourActivity.this.getCurrentFocus().getWindowToken(), 0); } ... });