summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/print
diff options
context:
space:
mode:
authorAlexandra Gherghina <alexgherghina@google.com>2014-09-18 10:59:43 +0100
committerAlexandra Gherghina <alexgherghina@google.com>2014-10-16 23:05:49 +0100
commit06cd50177a4eddf6e8fc86a5b935f6985d8d82c9 (patch)
tree34dae80cdf34da6c5d6e6eacd344a599d242c30d /src/com/android/settings/print
parent628d83e736f2f9e606327f3debe2930bb24a83e9 (diff)
downloadpackages_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/print')
-rw-r--r--src/com/android/settings/print/PrintSettingsFragment.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/com/android/settings/print/PrintSettingsFragment.java b/src/com/android/settings/print/PrintSettingsFragment.java
index 4a34875..b7c74da 100644
--- a/src/com/android/settings/print/PrintSettingsFragment.java
+++ b/src/com/android/settings/print/PrintSettingsFragment.java
@@ -124,6 +124,7 @@ public class PrintSettingsFragment extends SettingsPreferenceFragment
private PrintJobsController mPrintJobsController;
private UserSpinnerAdapter mProfileSpinnerAdapter;
+ private Spinner mSpinner;
@Override
public void onCreate(Bundle icicle) {
@@ -184,11 +185,11 @@ public class PrintSettingsFragment extends SettingsPreferenceFragment
final UserManager um = (UserManager) getSystemService(Context.USER_SERVICE);
mProfileSpinnerAdapter = Utils.createUserSpinnerAdapter(um, getActivity());
if (mProfileSpinnerAdapter != null) {
- Spinner spinner = (Spinner) getActivity().getLayoutInflater().inflate(
+ mSpinner = (Spinner) getActivity().getLayoutInflater().inflate(
R.layout.spinner_view, null);
- spinner.setAdapter(mProfileSpinnerAdapter);
- spinner.setOnItemSelectedListener(this);
- setPinnedHeaderView(spinner);
+ mSpinner.setAdapter(mProfileSpinnerAdapter);
+ mSpinner.setOnItemSelectedListener(this);
+ setPinnedHeaderView(mSpinner);
}
}
@@ -300,6 +301,8 @@ public class PrintSettingsFragment extends SettingsPreferenceFragment
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
getActivity().startActivityAsUser(intent, selectedUser);
+ // Go back to default selection, which is the first one
+ mSpinner.setSelection(0);
}
}