Ho un frammento con edittext in esso. quando faccio clic su edittext, la tastiera appare. il problema è quando apro il cassetto, il cassetto non nasconde la tastiera. la tastiera sta ancora mostrando anche io passare ad un altro frammento. Come posso nascondere la tastiera quando apro il cassetto.drawer di navigazione nascondi tastiera quando onDrawerOpened
Io cerco di mettere
InputMethodManager imm =
(InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(getWindowToken(), 0);
e
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
sia di esso non nascondere la tastiera.
Ho sempre avuto problemi a ottenere un 'WindowToken' da un' EditText' durante l'uso di 'Fragments' (essendo in' NavigationDrawer' o 'ViewPager'). 'Activity.getCurrentFocus()' era l'unica cosa che mi mancava. Grazie molto. – shkschneider