OSDN Git Service

Don't show the sort menu for running process list
authorKenny Root <kroot@google.com>
Tue, 12 Oct 2010 16:42:44 +0000 (09:42 -0700)
committerKenny Root <kroot@google.com>
Tue, 12 Oct 2010 16:44:43 +0000 (09:44 -0700)
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

src/com/android/settings/applications/ManageApplications.java

index 40f4ddd..1053d3b 100644 (file)
@@ -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;