diff options
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/browser/BrowserBookmarksPage.java | 5 | ||||
-rw-r--r-- | src/com/android/browser/BrowserHistoryPage.java | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/com/android/browser/BrowserBookmarksPage.java b/src/com/android/browser/BrowserBookmarksPage.java index 46521cb..2c38334 100644 --- a/src/com/android/browser/BrowserBookmarksPage.java +++ b/src/com/android/browser/BrowserBookmarksPage.java @@ -154,7 +154,10 @@ public class BrowserBookmarksPage extends Fragment implements View.OnCreateConte @Override public boolean onContextItemSelected(MenuItem item) { - BookmarkContextMenuInfo i = (BookmarkContextMenuInfo)item.getMenuInfo(); + if (!(item.getMenuInfo() instanceof BookmarkContextMenuInfo)) { + return false; + } + BookmarkContextMenuInfo i = (BookmarkContextMenuInfo) item.getMenuInfo(); // If we have no menu info, we can't tell which item was selected. if (i == null) { return false; diff --git a/src/com/android/browser/BrowserHistoryPage.java b/src/com/android/browser/BrowserHistoryPage.java index 6625e55..09c6f97 100644 --- a/src/com/android/browser/BrowserHistoryPage.java +++ b/src/com/android/browser/BrowserHistoryPage.java @@ -388,7 +388,11 @@ public class BrowserHistoryPage extends Fragment if (menuInfo == null) { return false; } - HistoryItem historyItem = (HistoryItem) getTargetView(menuInfo); + View targetView = getTargetView(menuInfo); + if (!(targetView instanceof HistoryItem)) { + return false; + } + HistoryItem historyItem = (HistoryItem) targetView; String url = historyItem.getUrl(); String title = historyItem.getName(); Activity activity = getActivity(); |