From c2e06072051e319bc609df66f4c72b77716f4fa4 Mon Sep 17 00:00:00 2001 From: Mike LeBeau Date: Thu, 30 Jul 2009 15:38:03 -0700 Subject: [PATCH] Tell the SearchManager to stopSearch before starting an in-app voice search. Without this, because of the recent changes to how the search dialog hides and resumes, we end up re-showing the search dialog after returning to the app from voice search, obscuring the new voice search results behind. Fixes http://b/2025364 --- core/java/android/app/SearchDialog.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/java/android/app/SearchDialog.java b/core/java/android/app/SearchDialog.java index ea3d762a9025..18e4a528ec46 100644 --- a/core/java/android/app/SearchDialog.java +++ b/core/java/android/app/SearchDialog.java @@ -903,6 +903,12 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS 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(); + getContext().startActivity(appSearchIntent); } } catch (ActivityNotFoundException e) { -- 2.11.0