You could bring up the menu and sort running processes by size or name
which would display the applications list at the same time the running
process list was being displayed. This happened because the
mApplicationsAdapter is used for the list of apps and is sortable, but
the running process list doesn't use the adapter.
Disable the menu when the running applications list is presented to
prevent this situation where two ListViews are visible.
Bug:
3084901
Change-Id: I5304cf7a1f426269ed4858e649729a35b9344717
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
+ /*
+ * The running processes screen doesn't use the mApplicationsAdapter
+ * so bringing up this menu in that case doesn't make any sense.
+ */
+ if (mCurView == VIEW_RUNNING) {
+ return false;
+ }
+
menu.findItem(SORT_ORDER_ALPHA).setVisible(mSortOrder != SORT_ORDER_ALPHA);
menu.findItem(SORT_ORDER_SIZE).setVisible(mSortOrder != SORT_ORDER_SIZE);
return true;