summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorLeon Scroggins <scroggo@google.com>2010-11-03 18:51:46 -0400
committerLeon Scroggins <scroggo@google.com>2010-11-03 18:51:46 -0400
commitc8cae086f23bd8f3d740befcdbbda9a8688cc2a3 (patch)
tree3c179bc02b4749f9bec478e45b10d0d90b25cb72 /src/com/android
parentbc5d9bc751e293c3268e3847afbfb4ce591cb9d2 (diff)
downloadpackages_apps_Browser-c8cae086f23bd8f3d740befcdbbda9a8688cc2a3.tar.gz
packages_apps_Browser-c8cae086f23bd8f3d740befcdbbda9a8688cc2a3.tar.bz2
packages_apps_Browser-c8cae086f23bd8f3d740befcdbbda9a8688cc2a3.zip
Allow context menu items to be handled properly.
Bug:3130048 BrowserBookmarksPage was claiming that it handled the MenuItem, so nothing was happening. BrowserHistoryPage assumed that the MenuInfo would always be non- null, and could cause a crash. Change-Id: Iaffbf88390f2513dc6ddb35a91ae097e873d5ae2
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/browser/BrowserBookmarksPage.java4
-rw-r--r--src/com/android/browser/BrowserHistoryPage.java3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/com/android/browser/BrowserBookmarksPage.java b/src/com/android/browser/BrowserBookmarksPage.java
index 4a3ae1f4f..88927bd3e 100644
--- a/src/com/android/browser/BrowserBookmarksPage.java
+++ b/src/com/android/browser/BrowserBookmarksPage.java
@@ -242,13 +242,13 @@ public class BrowserBookmarksPage extends Fragment implements View.OnCreateConte
// It is possible that the view has been canceled when we get to
// this point as back has a higher priority
if (mCanceled) {
- return true;
+ return false;
}
AdapterView.AdapterContextMenuInfo i =
(AdapterView.AdapterContextMenuInfo)item.getMenuInfo();
// If we have no menu info, we can't tell which item was selected.
if (i == null) {
- return true;
+ return false;
}
switch (item.getItemId()) {
diff --git a/src/com/android/browser/BrowserHistoryPage.java b/src/com/android/browser/BrowserHistoryPage.java
index 9a57946c6..3b0292dea 100644
--- a/src/com/android/browser/BrowserHistoryPage.java
+++ b/src/com/android/browser/BrowserHistoryPage.java
@@ -276,6 +276,9 @@ public class BrowserHistoryPage extends Fragment
public boolean onContextItemSelected(MenuItem item) {
ExpandableListContextMenuInfo i =
(ExpandableListContextMenuInfo) item.getMenuInfo();
+ if (i == null) {
+ return false;
+ }
HistoryItem historyItem = (HistoryItem) i.targetView;
String url = historyItem.getUrl();
String title = historyItem.getName();