We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 92d4e15 commit b967d59Copy full SHA for b967d59
WordPressUtils/src/main/java/org/wordpress/android/util/ActivityUtils.java
@@ -0,0 +1,16 @@
1
+package org.wordpress.android.util;
2
+
3
+import android.app.Activity;
4
+import android.content.Context;
5
+import android.view.inputmethod.InputMethodManager;
6
7
+public class ActivityUtils {
8
+ public static void hideKeyboard(Activity activity) {
9
+ if (activity != null && activity.getCurrentFocus() != null) {
10
+ InputMethodManager inputManager = (InputMethodManager) activity.getSystemService(
11
+ Context.INPUT_METHOD_SERVICE);
12
+ inputManager.hideSoftInputFromWindow(activity.getCurrentFocus().getWindowToken(),
13
+ InputMethodManager.HIDE_NOT_ALWAYS);
14
+ }
15
16
+}
0 commit comments