Fix a crash.
When the bookmarks page is opened to create a shortcut, there is
no menu. So do not modify it.
diff --git a/src/com/android/browser/BrowserBookmarksPage.java b/src/com/android/browser/BrowserBookmarksPage.java
index c97cc00..cf2dbc0 100644
--- a/src/com/android/browser/BrowserBookmarksPage.java
+++ b/src/com/android/browser/BrowserBookmarksPage.java
@@ -441,9 +441,10 @@
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
- if (mBookmarksAdapter.getCount() == 0) {
+ boolean result = super.onPrepareOptionsMenu(menu);
+ if (mCreateShortcut || mBookmarksAdapter.getCount() == 0) {
// No need to show the menu if there are no items.
- return false;
+ return result;
}
menu.findItem(R.id.switch_mode_menu_id).setTitle(
mGridMode ? R.string.switch_to_list