I have a ViewPager + ActionBar with tabs. I want to make the soft keyboard hide when I \"swipe\" to another tab but I can\'t figure out how.
I\'ve passed in my Activity
Common way:
private void hideVirturalKeyboard(){ View v = getCurrentFocus(); if (v != null && v instanceof EditText) { InputMethodManager mgr = (InputMethodManager)(v.getContext().getSystemService(Context.INPUT_METHOD_SERVIC E)); mgr.hideSoftInputFromWindow(v.getWindowToken(), 0); } }