OSDN Git Service

Allow Browser bookmarks from AnyCut; don't NPE without Extras.
authorBrad Fitzpatrick <bradfitz@android.com>
Fri, 19 Mar 2010 20:35:21 +0000 (13:35 -0700)
committerBrad Fitzpatrick <bradfitz@android.com>
Fri, 19 Mar 2010 20:35:21 +0000 (13:35 -0700)
Change-Id: I884936ceaeabf76cc8aaf7f1dbfeecd82b5c2fd0

AndroidManifest.xml
src/com/android/browser/CombinedBookmarkHistoryActivity.java

index 798fc3a..50a7be0 100644 (file)
                     android:resource="@xml/searchable" />
         </activity>
 
-        <activity android:name="CombinedBookmarkHistoryActivity" android:label=""
+        <activity android:name="CombinedBookmarkHistoryActivity" android:label="@string/bookmarks"
+                  android:excludeFromRecents="true"
                   android:launchMode="singleTop" android:configChanges="orientation|keyboardHidden"
                   android:theme="@style/BookmarkTheme" >
             <meta-data android:name="android.app.default_searchable"
                     android:value=".BrowserActivity" />
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+            </intent-filter>
         </activity>
 
         <activity android:name="BrowserBookmarksPage" android:label="@string/bookmarks"
index c435239..194956f 100644 (file)
@@ -100,25 +100,30 @@ public class CombinedBookmarkHistoryActivity extends TabActivity
         Bundle extras = getIntent().getExtras();
 
         Intent bookmarksIntent = new Intent(this, BrowserBookmarksPage.class);
-        bookmarksIntent.putExtras(extras);
+        if (extras != null) {
+            bookmarksIntent.putExtras(extras);
+        }
         createTab(bookmarksIntent, R.string.tab_bookmarks,
                 R.drawable.browser_bookmark_tab, BOOKMARKS_TAB);
 
         Intent visitedIntent = new Intent(this, BrowserBookmarksPage.class);
         // Need to copy extras so the bookmarks activity and this one will be
         // different
-        Bundle visitedExtras = new Bundle(extras);
+        Bundle visitedExtras = extras == null ? new Bundle() : new Bundle(extras);
         visitedExtras.putBoolean("mostVisited", true);
         visitedIntent.putExtras(visitedExtras);
         createTab(visitedIntent, R.string.tab_most_visited,
                 R.drawable.browser_visited_tab, VISITED_TAB);
 
         Intent historyIntent = new Intent(this, BrowserHistoryPage.class);
-        historyIntent.putExtras(extras);
+        String defaultTab = null;
+        if (extras != null) {
+            historyIntent.putExtras(extras);
+            defaultTab = extras.getString(STARTING_TAB);
+        }
         createTab(historyIntent, R.string.tab_history,
                 R.drawable.browser_history_tab, HISTORY_TAB);
 
-        String defaultTab = extras.getString(STARTING_TAB);
         if (defaultTab != null) {
             getTabHost().setCurrentTab(2);
         }