From 786422a027ec6badcc3e639e5222d1b900abac53 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 20 Sep 2012 01:39:38 +0400 Subject: [PATCH] fix two context menu crashes --- AndroidManifest.xml | 2 +- src/org/fox/ttrss/FeedCategoriesFragment.java | 4 ++++ src/org/fox/ttrss/FeedsFragment.java | 3 +-- src/org/fox/ttrss/HeadlinesFragment.java | 2 +- src/org/fox/ttrss/offline/OfflineFeedCategoriesFragment.java | 4 ++++ src/org/fox/ttrss/offline/OfflineFeedsFragment.java | 4 ++++ 6 files changed, 15 insertions(+), 4 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 1f72589d..43562a87 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,7 +1,7 @@ = 1); menu.findItem(R.id.article_set_note).setEnabled(m_activity.getApiLevel() >= 1); - + super.onCreateContextMenu(menu, v, menuInfo); } diff --git a/src/org/fox/ttrss/offline/OfflineFeedCategoriesFragment.java b/src/org/fox/ttrss/offline/OfflineFeedCategoriesFragment.java index d46e5587..a5595681 100644 --- a/src/org/fox/ttrss/offline/OfflineFeedCategoriesFragment.java +++ b/src/org/fox/ttrss/offline/OfflineFeedCategoriesFragment.java @@ -46,6 +46,10 @@ public class OfflineFeedCategoriesFragment extends Fragment implements OnItemCli if (cursor != null) menu.setHeaderTitle(cursor.getString(cursor.getColumnIndex("title"))); + if (!m_activity.isSmallScreen()) { + menu.findItem(R.id.browse_articles).setVisible(false); + } + super.onCreateContextMenu(menu, v, menuInfo); } diff --git a/src/org/fox/ttrss/offline/OfflineFeedsFragment.java b/src/org/fox/ttrss/offline/OfflineFeedsFragment.java index 87af187c..7eadd373 100644 --- a/src/org/fox/ttrss/offline/OfflineFeedsFragment.java +++ b/src/org/fox/ttrss/offline/OfflineFeedsFragment.java @@ -85,6 +85,10 @@ public class OfflineFeedsFragment extends Fragment implements OnItemClickListene if (cursor != null) menu.setHeaderTitle(cursor.getString(cursor.getColumnIndex("title"))); + if (!m_activity.isSmallScreen()) { + menu.findItem(R.id.browse_articles).setVisible(false); + } + super.onCreateContextMenu(menu, v, menuInfo); }