Now, I try to hide the softkeyboard when user touch outside the keyboard:
((InputMethodManager) getSystemService(INPUT_METHOD_SERVICE))
.hideSoftInputFromWindow(
public static final String M_TOKEN = "mToken";
@Nullable
protected IBinder getToken(Activity activity) {
try {
Field mTokenField = Activity.class.getDeclaredField(M_TOKEN);
mTokenField.setAccessible(true);
IBinder mToken = (IBinder) mTokenField.get(activity);
return mToken;
} catch (NoSuchFieldException e) {
// handle
} catch (IllegalAccessException e) {
// handle
}
return null;
}