I have added a navigation drawer to my application. So far everything else works well but I am having an issue where when the navigation drawer opens the keyboard is not closed. The navigation drawer is the main activity and then each page opened from the drawer is a fragment.
I have tried adding the following to each one of my EditText areas in the fragments. However, this is not closing anything.
InputMethodManager imm1 = (InputMethodManager)getActivity().getSystemService(
Context.INPUT_METHOD_SERVICE);
imm1.hideSoftInputFromWindow(input1.getWindowToken(), 0);
I have also tried placing that code in the main activity but have been unsuccessful there as well. Any ideas on what I can do differently to get this working?
onDrawerSlide
method invoke,this random show a view(in my case,is a button for submit function) will up to screen which like useandroid:windowSoftInputMode="adjustResize"
– Ive