From 673085af9e5e040eb0109138e9cb6916fa4b88f0 Mon Sep 17 00:00:00 2001 From: Kenny Root Date: Tue, 12 Oct 2010 09:42:44 -0700 Subject: [PATCH] Don't show the sort menu for running process list 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 --- .../android/settings/applications/ManageApplications.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/com/android/settings/applications/ManageApplications.java b/src/com/android/settings/applications/ManageApplications.java index 40f4dddca09..1053d3bfabe 100644 --- a/src/com/android/settings/applications/ManageApplications.java +++ b/src/com/android/settings/applications/ManageApplications.java @@ -614,6 +614,14 @@ public class ManageApplications extends TabActivity implements @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;