revert to previous back button handling but check whether backstack is not empty to prevent inability to exit the app

This commit is contained in:
Andrew Dolgov 2014-11-08 02:32:05 +03:00
parent a509415720
commit b171b64d51
2 changed files with 14 additions and 2 deletions

View File

@ -378,7 +378,13 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe
@Override @Override
public void onBackPressed() { public void onBackPressed() {
finish(); if (m_drawerLayout != null && !m_drawerLayout.isDrawerOpen(Gravity.START) &&
getSupportFragmentManager().getBackStackEntryCount() > 0) {
m_drawerLayout.openDrawer(Gravity.START);
} else {
super.onBackPressed();
}
} }
@Override @Override

View File

@ -264,7 +264,13 @@ public class OfflineFeedsActivity extends OfflineActivity implements OfflineHead
@Override @Override
public void onBackPressed() { public void onBackPressed() {
finish(); if (m_drawerLayout != null && !m_drawerLayout.isDrawerOpen(Gravity.START) &&
getSupportFragmentManager().getBackStackEntryCount() > 0) {
m_drawerLayout.openDrawer(Gravity.START);
} else {
super.onBackPressed();
}
} }
public void onFeedSelected(int feedId) { public void onFeedSelected(int feedId) {