From 73cf0c07a68f3c35e3d397e56a7acedd637d5e42 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 6 Nov 2014 18:20:44 +0300 Subject: [PATCH] allow using actionbar <- button to open parent category if backstack is not empty --- .../src/main/java/org/fox/ttrss/FeedsActivity.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsActivity.java index 8239d9f6..6b51ad16 100644 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsActivity.java @@ -296,14 +296,19 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe @Override public boolean onOptionsItemSelected(MenuItem item) { + + if (item.getItemId() == android.R.id.home && getSupportFragmentManager().getBackStackEntryCount() > 0) { + if (m_drawerLayout != null && m_drawerLayout.isDrawerOpen(Gravity.START)) { + getSupportFragmentManager().popBackStack(); + return true; + } + } + if (m_drawerToggle != null && m_drawerToggle.onOptionsItemSelected(item)) { return true; } switch (item.getItemId()) { - case android.R.id.home: - //getSupportFragmentManager().popBackStack(); - return true; case R.id.headlines_toggle_sort_order: Dialog dialog = new Dialog(this);