From c8cae086f23bd8f3d740befcdbbda9a8688cc2a3 Mon Sep 17 00:00:00 2001 From: Leon Scroggins Date: Wed, 3 Nov 2010 18:51:46 -0400 Subject: 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 --- src/com/android/browser/BrowserHistoryPage.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/com/android/browser/BrowserHistoryPage.java') 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(); -- cgit v1.2.3