diff options
author | Suchi Amalapurapu <asuchitra@google.com> | 2009-09-23 16:33:56 -0700 |
---|---|---|
committer | Suchi Amalapurapu <asuchitra@google.com> | 2009-09-23 16:57:55 -0700 |
commit | 6cf44dbe90e3215715c713874c357d0bd26b8102 (patch) | |
tree | e376653f81a07d867aea280b3863fbaee1c48094 /src/com/android/settings/ManageApplications.java | |
parent | 9045631186a4f7fcf49a3f4700276ad8fbcab90c (diff) | |
download | packages_apps_Settings-6cf44dbe90e3215715c713874c357d0bd26b8102.tar.gz packages_apps_Settings-6cf44dbe90e3215715c713874c357d0bd26b8102.tar.bz2 packages_apps_Settings-6cf44dbe90e3215715c713874c357d0bd26b8102.zip |
Set selection in single choice list.
Reorder the menu entries to use the menu options as indices into
the choice box directly
Diffstat (limited to 'src/com/android/settings/ManageApplications.java')
-rw-r--r-- | src/com/android/settings/ManageApplications.java | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/com/android/settings/ManageApplications.java b/src/com/android/settings/ManageApplications.java index 3d0366612..21647a897 100644 --- a/src/com/android/settings/ManageApplications.java +++ b/src/com/android/settings/ManageApplications.java @@ -134,13 +134,13 @@ public class ManageApplications extends ListActivity implements // sort order that can be changed through the menu can be sorted alphabetically // or size(descending) private static final int MENU_OPTIONS_BASE = 0; - public static final int SORT_ORDER_ALPHA = MENU_OPTIONS_BASE + 0; - public static final int SORT_ORDER_SIZE = MENU_OPTIONS_BASE + 1; // Filter options used for displayed list of applications - public static final int FILTER_APPS_ALL = MENU_OPTIONS_BASE + 2; - public static final int FILTER_APPS_THIRD_PARTY = MENU_OPTIONS_BASE + 3; - public static final int FILTER_APPS_RUNNING = MENU_OPTIONS_BASE + 4; - public static final int FILTER_OPTIONS = MENU_OPTIONS_BASE + 5; + public static final int FILTER_APPS_ALL = MENU_OPTIONS_BASE + 0; + public static final int FILTER_APPS_RUNNING = MENU_OPTIONS_BASE + 1; + public static final int FILTER_APPS_THIRD_PARTY = MENU_OPTIONS_BASE + 2; + public static final int FILTER_OPTIONS = MENU_OPTIONS_BASE + 3; + public static final int SORT_ORDER_ALPHA = MENU_OPTIONS_BASE + 4; + public static final int SORT_ORDER_SIZE = MENU_OPTIONS_BASE + 5; // Alert Dialog presented to user to find out the filter option private AlertDialog mAlertDlg; // sort order @@ -1953,6 +1953,8 @@ public class ManageApplications extends ListActivity implements if ((menuId == SORT_ORDER_ALPHA) || (menuId == SORT_ORDER_SIZE)) { sendMessageToHandler(REORDER_LIST, menuId); } else if (menuId == FILTER_OPTIONS) { + // Pick up the selection value from the list of added choice items. + int selection = mFilterApps - MENU_OPTIONS_BASE; if (mAlertDlg == null) { mAlertDlg = new AlertDialog.Builder(this). setTitle(R.string.filter_dlg_title). @@ -1960,7 +1962,7 @@ public class ManageApplications extends ListActivity implements setSingleChoiceItems(new CharSequence[] {getText(R.string.filter_apps_all), getText(R.string.filter_apps_running), getText(R.string.filter_apps_third_party)}, - -1, this). + selection, this). create(); } mAlertDlg.show(); @@ -1985,18 +1987,16 @@ public class ManageApplications extends ListActivity implements switch (which) { // Make sure that values of 0, 1, 2 match options all, running, third_party when // created via the AlertDialog.Builder - case 0: - newOption = FILTER_APPS_ALL; + case FILTER_APPS_ALL: break; - case 1: - newOption = FILTER_APPS_RUNNING; + case FILTER_APPS_RUNNING: break; - case 2: - newOption = FILTER_APPS_THIRD_PARTY; + case FILTER_APPS_THIRD_PARTY: break; default: return; } + newOption = which; mAlertDlg.dismiss(); sendMessageToHandler(REORDER_LIST, newOption); } |