I have a tabbed view with one Activity per tab, and when I switch from the first tab, which has a TextView, to the second tab, which only shows a clickable list, the soft keyboard is still there. I want it to go away, so I tried this:
public static void hideSoftKeyboard (Activity activity, View view) {
InputMethodManager imm = (InputMethodManager)activity.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
}
but this does not work, because there is no relevant view to provide, as there is no View on the screen that takes keyboard input. Any suggestions on how to solve this?