diff options
author | Alexandra Gherghina <alexgherghina@google.com> | 2014-09-18 10:59:43 +0100 |
---|---|---|
committer | Alexandra Gherghina <alexgherghina@google.com> | 2014-10-16 23:05:49 +0100 |
commit | 06cd50177a4eddf6e8fc86a5b935f6985d8d82c9 (patch) | |
tree | 34dae80cdf34da6c5d6e6eacd344a599d242c30d /src/com/android/settings/applications | |
parent | 628d83e736f2f9e606327f3debe2930bb24a83e9 (diff) | |
download | packages_apps_Settings-06cd50177a4eddf6e8fc86a5b935f6985d8d82c9.zip packages_apps_Settings-06cd50177a4eddf6e8fc86a5b935f6985d8d82c9.tar.gz packages_apps_Settings-06cd50177a4eddf6e8fc86a5b935f6985d8d82c9.tar.bz2 |
Reset spinner selection
This makes sure that when you go back to the spinner screen, the
selection is the one corresponding to the current profile.
Bug: 17378446
Change-Id: I536cc2701f9481986a63df1b01a38151edf2fa83
Diffstat (limited to 'src/com/android/settings/applications')
-rw-r--r-- | src/com/android/settings/applications/ManageApplications.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/com/android/settings/applications/ManageApplications.java b/src/com/android/settings/applications/ManageApplications.java index e64e56e..03e178a 100644 --- a/src/com/android/settings/applications/ManageApplications.java +++ b/src/com/android/settings/applications/ManageApplications.java @@ -252,10 +252,10 @@ public class ManageApplications extends Fragment implements : R.layout.manage_applications_apps, null); mPinnedHeader = (ViewGroup) mRootView.findViewById(R.id.pinned_header); if (mOwner.mProfileSpinnerAdapter != null) { - Spinner spinner = (Spinner) inflater.inflate(R.layout.spinner_view, null); - spinner.setAdapter(mOwner.mProfileSpinnerAdapter); - spinner.setOnItemSelectedListener(mOwner); - mPinnedHeader.addView(spinner); + mOwner.mSpinner = (Spinner) inflater.inflate(R.layout.spinner_view, null); + mOwner.mSpinner.setAdapter(mOwner.mProfileSpinnerAdapter); + mOwner.mSpinner.setOnItemSelectedListener(mOwner); + mPinnedHeader.addView(mOwner.mSpinner); mPinnedHeader.setVisibility(View.VISIBLE); } mLoadingContainer = mRootView.findViewById(R.id.loading_container); @@ -483,6 +483,7 @@ public class ManageApplications extends Fragment implements private View mRootView; private ViewPager mViewPager; private UserSpinnerAdapter mProfileSpinnerAdapter; + private Spinner mSpinner; private Context mContext; AlertDialog mResetDialog; @@ -1045,6 +1046,9 @@ public class ManageApplications extends Fragment implements int currentTab = mViewPager.getCurrentItem(); intent.putExtra(EXTRA_LIST_TYPE, mTabs.get(currentTab).mListType); mContext.startActivityAsUser(intent, selectedUser); + // Go back to default selection, which is the first one; this makes sure that pressing + // the back button takes you into a consistent state + mSpinner.setSelection(0); } } |