Skip to content

Commit 957c1b2

Browse files
committed
first step at replacing PreferenceActivity by a PreferenceFragment + ActionBarActivity
1 parent 93a23da commit 957c1b2

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)