allow using actionbar <- button to open parent category if backstack is not empty

This commit is contained in:
Andrew Dolgov 2014-11-06 18:20:44 +03:00
parent 095721c704
commit 73cf0c07a6

View File

@ -296,14 +296,19 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe
@Override @Override
public boolean onOptionsItemSelected(MenuItem item) { 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)) { if (m_drawerToggle != null && m_drawerToggle.onOptionsItemSelected(item)) {
return true; return true;
} }
switch (item.getItemId()) { switch (item.getItemId()) {
case android.R.id.home:
//getSupportFragmentManager().popBackStack();
return true;
case R.id.headlines_toggle_sort_order: case R.id.headlines_toggle_sort_order:
Dialog dialog = new Dialog(this); Dialog dialog = new Dialog(this);