diff options
| author | 2009-08-04 13:24:19 -0700 | |
|---|---|---|
| committer | 2009-08-04 13:24:19 -0700 | |
| commit | c5e7fe36fbb79ea888da636779318d3e430aa24c (patch) | |
| tree | 83a6adc621044ffad3f302eb5a23b78e7f3f19bb | |
| parent | c134c281ca83a28deb96c7b338c48c0b0327f26f (diff) | |
Close the search dialog before starting voice search in all cases, i.e.,
also when launching web search, not just when it's using the intent API.
| -rw-r--r-- | core/java/android/app/SearchDialog.java | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/core/java/android/app/SearchDialog.java b/core/java/android/app/SearchDialog.java index 18e4a528ec46..1d53eabc3d79 100644 --- a/core/java/android/app/SearchDialog.java +++ b/core/java/android/app/SearchDialog.java @@ -899,16 +899,15 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS return; } try { + // First stop the existing search before starting voice search, or else we'll end + // up showing the search dialog again once we return to the app. + ((SearchManager) getContext().getSystemService(Context.SEARCH_SERVICE)). + stopSearch(); + if (mSearchable.getVoiceSearchLaunchWebSearch()) { getContext().startActivity(mVoiceWebSearchIntent); } else if (mSearchable.getVoiceSearchLaunchRecognizer()) { - Intent appSearchIntent = createVoiceAppSearchIntent(mVoiceAppSearchIntent); - - // Stop the existing search before starting voice search, or else we'll end - // up showing the search dialog again once we return to the app. - ((SearchManager) getContext().getSystemService(Context.SEARCH_SERVICE)). - stopSearch(); - + Intent appSearchIntent = createVoiceAppSearchIntent(mVoiceAppSearchIntent); getContext().startActivity(appSearchIntent); } } catch (ActivityNotFoundException e) { |