diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-09-27 14:36:14 +0200 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-09-27 14:36:14 +0200 |
commit | d20f657151b038c25dc071dd9d227380d09ff866 (patch) | |
tree | 57fa6c584f3a46dd44f647bff259cabac1792da7 | |
parent | f22bbbd96cba818ac01ad7b7c472bfe29c31fff4 (diff) | |
download | open-keychain-d20f657151b038c25dc071dd9d227380d09ff866.tar.gz open-keychain-d20f657151b038c25dc071dd9d227380d09ff866.tar.bz2 open-keychain-d20f657151b038c25dc071dd9d227380d09ff866.zip |
Hide keyboard after cloud search
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysCloudFragment.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysCloudFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysCloudFragment.java index 40a60f119..2b5a9793c 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysCloudFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysCloudFragment.java @@ -155,6 +155,19 @@ public class ImportKeysCloudFragment extends Fragment { private void search(String query) { Preferences prefs = Preferences.getPreferences(getActivity()); mImportActivity.loadCallback(new ImportKeysListFragment.CloudLoaderState(query, prefs.getCloudSearchPrefs())); + hideKeyboard(); + } + + private void hideKeyboard() { + InputMethodManager inputManager = (InputMethodManager) getActivity() + .getSystemService(Context.INPUT_METHOD_SERVICE); + + // check if no view has focus + View v = getActivity().getCurrentFocus(); + if (v == null) + return; + + inputManager.hideSoftInputFromWindow(v.getWindowToken(), 0); } } |