Hide keyboard after cloud search

This commit is contained in:
Dominik Schürmann 2014-09-27 14:36:14 +02:00
parent f22bbbd96c
commit d20f657151

View File

@ -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);
}
}