Skip to content

Commit

Permalink
first step at replacing PreferenceActivity by a PreferenceFragment + …
Browse files Browse the repository at this point in the history
…ActionBarActivity
  • Loading branch information
maxme committed Nov 14, 2014
1 parent 92d4e15 commit b967d59
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.wordpress.android.util;

import android.app.Activity;
import android.content.Context;
import android.view.inputmethod.InputMethodManager;

public class ActivityUtils {
public static void hideKeyboard(Activity activity) {
if (activity != null && activity.getCurrentFocus() != null) {
InputMethodManager inputManager = (InputMethodManager) activity.getSystemService(
Context.INPUT_METHOD_SERVICE);
inputManager.hideSoftInputFromWindow(activity.getCurrentFocus().getWindowToken(),
InputMethodManager.HIDE_NOT_ALWAYS);
}
}
}

0 comments on commit b967d59

Please sign in to comment.