OSDN Git Service

Force a load when getting a new intent from voice search.
authorLeon Scroggins <scroggo@google.com>
Mon, 15 Mar 2010 17:10:45 +0000 (13:10 -0400)
committerLeon Scroggins <scroggo@google.com>
Mon, 15 Mar 2010 18:18:14 +0000 (14:18 -0400)
When reusing an app tab, we generally do not reload in the case
where the URL matches the old URL.  However, in the case of a
voice search, both URLs are "", because the information is held
in UrlData.mVoiceIntent.  If that field is not null, load the
Tab, which will load the new voice search.

Change-Id: I0ba60b1e482cf1fd1b95e4dab969527f18096cc1

src/com/android/browser/BrowserActivity.java

index 4308a2c..4a4e325 100644 (file)
@@ -553,7 +553,11 @@ public class BrowserActivity extends Activity
                     // If the WebView has the same original url and is on that
                     // page, it can be reused.
                     boolean needsLoad =
-                            mTabControl.recreateWebView(appTab, urlData.mUrl);
+                            mTabControl.recreateWebView(appTab, urlData.mUrl)
+                            // If there is a voice intent in the UrlData, then
+                            // recreateWebView may return false, but we still
+                            // need to force a load.
+                            || urlData.mVoiceIntent != null;
 
                     if (current != appTab) {
                         switchToTab(mTabControl.getTabIndex(appTab));