Browse Source

Fix bug/crash when opening contextual action bar on tablet layout where two different cab's are present.

pull/222/merge
Eric Kok 10 years ago
parent
commit
f3622bbc2b
  1. 3
      app/src/main/java/org/transdroid/core/gui/DetailsFragment.java
  2. 3
      app/src/main/java/org/transdroid/core/gui/TorrentsFragment.java

3
app/src/main/java/org/transdroid/core/gui/DetailsFragment.java

@ -485,9 +485,8 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen @@ -485,9 +485,8 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
return onActionItemClicked(mode, menuItem);
}
});
if (contextualMenu.getMenu().size() == 0) {
contextualMenu.getMenu().clear();
getActivity().getMenuInflater().inflate(R.menu.fragment_details_cab_main, contextualMenu.getMenu());
}
Context themedContext = ((ActionBarActivity) getActivity()).getSupportActionBar().getThemedContext();
mode.getMenuInflater().inflate(R.menu.fragment_details_cab_secondary, menu);
selectionManagerMode = new SelectionManagerMode(themedContext, detailsList, R.plurals.navigation_filesselected);

3
app/src/main/java/org/transdroid/core/gui/TorrentsFragment.java

@ -279,9 +279,8 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener @@ -279,9 +279,8 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
return onActionItemClicked(mode, menuItem);
}
});
if (actionsMenu.getMenu().size() == 0) {
actionsMenu.getMenu().clear();
getActivity().getMenuInflater().inflate(R.menu.fragment_torrents_cab, actionsMenu.getMenu());
}
Context themedContext = ((ActionBarActivity) getActivity()).getSupportActionBar().getThemedContext();
selectionManagerMode = new SelectionManagerMode(themedContext, torrentsList, R.plurals.navigation_torrentsselected);
selectionManagerMode.onCreateActionMode(mode, menu);

Loading…
Cancel
Save