I am trying to hide keyboard after selecting an item from Spinner
but the code is not working and nothing happens. But in other side the same code works in normal fragment.
Here is the method to hide keyboard:
public static void hideKeypad(Activity activity) {
View view = activity.getCurrentFocus();
if (view != null) {
InputMethodManager imm = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
}
}