diff options
author | Bananeweizen <bananeweizen@gmx.de> | 2013-08-05 19:09:06 +0200 |
---|---|---|
committer | Bananeweizen <bananeweizen@gmx.de> | 2013-08-05 19:09:06 +0200 |
commit | c323445a9c1c7e834b36cbb59dc1ecfe7aaa771a (patch) | |
tree | da554b83c35bc127cbb71c68ac7b49e9b4a9498c /main | |
parent | 0751fb4bcb9f7a0b6916b81e686e777ec0cb0500 (diff) | |
download | cgeo-c323445a9c1c7e834b36cbb59dc1ecfe7aaa771a.zip cgeo-c323445a9c1c7e834b36cbb59dc1ecfe7aaa771a.tar.gz cgeo-c323445a9c1c7e834b36cbb59dc1ecfe7aaa771a.tar.bz2 |
fix #3107: onscreen keyboard remains after failed search
Diffstat (limited to 'main')
-rw-r--r-- | main/src/cgeo/geocaching/SearchActivity.java | 1 | ||||
-rw-r--r-- | main/src/cgeo/geocaching/activity/AbstractActivity.java | 8 |
2 files changed, 8 insertions, 1 deletions
diff --git a/main/src/cgeo/geocaching/SearchActivity.java b/main/src/cgeo/geocaching/SearchActivity.java index ccf3edf..57b391f 100644 --- a/main/src/cgeo/geocaching/SearchActivity.java +++ b/main/src/cgeo/geocaching/SearchActivity.java @@ -63,6 +63,7 @@ public class SearchActivity extends AbstractActivity { // search query final Intent intent = getIntent(); if (Intent.ACTION_SEARCH.equals(intent.getAction())) { + hideKeyboard(); final String query = intent.getStringExtra(SearchManager.QUERY); final boolean keywordSearch = intent.getBooleanExtra(Intents.EXTRA_KEYWORD_SEARCH, true); diff --git a/main/src/cgeo/geocaching/activity/AbstractActivity.java b/main/src/cgeo/geocaching/activity/AbstractActivity.java index 9aca35e..28c0cdd 100644 --- a/main/src/cgeo/geocaching/activity/AbstractActivity.java +++ b/main/src/cgeo/geocaching/activity/AbstractActivity.java @@ -2,16 +2,18 @@ package cgeo.geocaching.activity; import butterknife.Views; -import cgeo.geocaching.settings.Settings; import cgeo.geocaching.cgeoapplication; import cgeo.geocaching.compatibility.Compatibility; import cgeo.geocaching.network.Cookies; +import cgeo.geocaching.settings.Settings; +import android.content.Context; import android.content.res.Resources; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.view.View; +import android.view.inputmethod.InputMethodManager; import android.widget.EditText; public abstract class AbstractActivity extends FragmentActivity implements IAbstractActivity { @@ -113,4 +115,8 @@ public abstract class AbstractActivity extends FragmentActivity implements IAbst // initialize the action bar title with the activity title for single source ActivityMixin.setTitle(this, getTitle()); } + + protected void hideKeyboard() { + ((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE)).toggleSoftInput(InputMethodManager.SHOW_IMPLICIT, 0); + } } |