diff options
author | Dianne Hackborn <hackbod@google.com> | 2012-05-29 17:21:05 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2012-05-29 17:21:05 -0700 |
commit | 13ba7e655643f664aa134e45362e155f18d42931 (patch) | |
tree | a35d883207229022320a02692559b19c058ed73c /src | |
parent | 16bf0e0ec7dbd606ea5a5c8a1a9653f1cbb6d9b6 (diff) | |
download | packages_apps_settings-13ba7e655643f664aa134e45362e155f18d42931.zip packages_apps_settings-13ba7e655643f664aa134e45362e155f18d42931.tar.gz packages_apps_settings-13ba7e655643f664aa134e45362e155f18d42931.tar.bz2 |
Fix issue where Manage Apps would not start on correct page.
We weren't setting the correct initial page in the view
pager.
Change-Id: I68846505a4f23547e9b09e4bc06e3d455ae9556f
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/applications/ManageApplications.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/com/android/settings/applications/ManageApplications.java b/src/com/android/settings/applications/ManageApplications.java index 88eaef1..1cc9dcc 100644 --- a/src/com/android/settings/applications/ManageApplications.java +++ b/src/com/android/settings/applications/ManageApplications.java @@ -137,7 +137,6 @@ public class ManageApplications extends Fragment implements static final String TAG = "ManageApplications"; static final boolean DEBUG = false; - private static final String EXTRA_FILTER_APPS = "filterApps"; private static final String EXTRA_SORT_ORDER = "sortOrder"; private static final String EXTRA_SHOW_BACKGROUND = "showBackground"; private static final String EXTRA_DEFAULT_LIST_TYPE = "defaultListType"; @@ -168,8 +167,6 @@ public class ManageApplications extends Fragment implements public static final int RESET_APP_PREFERENCES = MENU_OPTIONS_BASE + 8; // sort order private int mSortOrder = SORT_ORDER_ALPHA; - // Filter value - private int mFilterApps = FILTER_APPS_THIRD_PARTY; private ApplicationsState mApplicationsState; @@ -825,7 +822,6 @@ public class ManageApplications extends Fragment implements || Intent.ACTION_MANAGE_PACKAGE_STORAGE.equals(action) || className.endsWith(".StorageUse")) { mSortOrder = SORT_ORDER_SIZE; - mFilterApps = FILTER_APPS_ALL; defaultListType = LIST_TYPE_ALL; } else if (Settings.ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS.equals(action)) { // Select the all-apps list, with the default sorting @@ -834,7 +830,6 @@ public class ManageApplications extends Fragment implements if (savedInstanceState != null) { mSortOrder = savedInstanceState.getInt(EXTRA_SORT_ORDER, mSortOrder); - mFilterApps = savedInstanceState.getInt(EXTRA_FILTER_APPS, mFilterApps); int tmp = savedInstanceState.getInt(EXTRA_DEFAULT_LIST_TYPE, -1); if (tmp != -1) defaultListType = tmp; mShowBackground = savedInstanceState.getBoolean(EXTRA_SHOW_BACKGROUND, false); @@ -900,6 +895,17 @@ public class ManageApplications extends Fragment implements buildResetDialog(); } + if (savedInstanceState == null) { + // First time init: make sure view pager is showing the correct tab. + for (int i = 0; i < mTabs.size(); i++) { + TabInfo tab = mTabs.get(i); + if (tab.mListType == mDefaultListType) { + mViewPager.setCurrentItem(i); + break; + } + } + } + return rootView; } @@ -920,7 +926,6 @@ public class ManageApplications extends Fragment implements public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putInt(EXTRA_SORT_ORDER, mSortOrder); - outState.putInt(EXTRA_FILTER_APPS, mFilterApps); if (mDefaultListType != -1) { outState.putInt(EXTRA_DEFAULT_LIST_TYPE, mDefaultListType); } |