From ff598602bd86c09aef64662345699637e753162a Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 9 Dec 2011 22:28:37 +0300 Subject: [PATCH] fix contextual actionbar for 2.x --- AndroidManifest.xml | 2 +- src/org/fox/ttrss/MainActivity.java | 6 +++++- src/org/fox/ttrss/OfflineActivity.java | 6 +++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 289dd0c3..362e23b6 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -4,7 +4,7 @@ android:versionCode="39" android:versionName="0.3.6" > - + diff --git a/src/org/fox/ttrss/MainActivity.java b/src/org/fox/ttrss/MainActivity.java index cb090dba..6c4672ee 100644 --- a/src/org/fox/ttrss/MainActivity.java +++ b/src/org/fox/ttrss/MainActivity.java @@ -68,7 +68,9 @@ public class MainActivity extends FragmentActivity implements OnlineServices { private SQLiteDatabase m_writableDb; private ActionMode m_headlinesActionMode; - private ActionMode.Callback m_headlinesActionModeCallback = new ActionMode.Callback() { + private HeadlinesActionModeCallback m_headlinesActionModeCallback; + + private class HeadlinesActionModeCallback implements ActionMode.Callback { @Override public boolean onPrepareActionMode(ActionMode mode, Menu menu) { @@ -484,6 +486,8 @@ public class MainActivity extends FragmentActivity implements OnlineServices { if (!m_compatMode) { new TransitionHelper((LinearLayout) findViewById(R.id.main)); + + m_headlinesActionModeCallback = new HeadlinesActionModeCallback(); } if (m_isOffline) { diff --git a/src/org/fox/ttrss/OfflineActivity.java b/src/org/fox/ttrss/OfflineActivity.java index 4f6a0089..7cbf8787 100644 --- a/src/org/fox/ttrss/OfflineActivity.java +++ b/src/org/fox/ttrss/OfflineActivity.java @@ -54,7 +54,9 @@ public class OfflineActivity extends FragmentActivity implements } private ActionMode m_headlinesActionMode; - private ActionMode.Callback m_headlinesActionModeCallback = new ActionMode.Callback() { + private HeadlinesActionModeCallback m_headlinesActionModeCallback; + + private class HeadlinesActionModeCallback implements ActionMode.Callback { @Override public boolean onPrepareActionMode(ActionMode mode, Menu menu) { @@ -135,6 +137,8 @@ public class OfflineActivity extends FragmentActivity implements if (!m_compatMode) { new TransitionHelper((LinearLayout) findViewById(R.id.main)); + + m_headlinesActionModeCallback = new HeadlinesActionModeCallback(); } initMainMenu();