summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/profiles
diff options
context:
space:
mode:
authorDanesh M <daneshm90@gmail.com>2015-09-30 15:52:08 -0700
committerAdnan Begovic <adnan@cyngn.com>2015-10-27 14:09:46 -0700
commit32595464601e7d20eb0283aac5d110a70129d4a2 (patch)
tree3004716ce960d2c6384ab1a58106003f632462bd /src/com/android/settings/profiles
parentc799ad4db86472f23f65597dd4f9002516059fdd (diff)
downloadpackages_apps_Settings-32595464601e7d20eb0283aac5d110a70129d4a2.zip
packages_apps_Settings-32595464601e7d20eb0283aac5d110a70129d4a2.tar.gz
packages_apps_Settings-32595464601e7d20eb0283aac5d110a70129d4a2.tar.bz2
Settings : Fix profile action offset when changing orientation
If a listview has headers/footers, getItemAtPosition takes that into account given a position. When we restore state, we fetch it from the adapter which has no concept of header/footer. Fix this by storing the position in the adapter itself. Repro: 1) Create new profile 2) Skip triggers 3) Click one of the preferences 4) Rotate phone 5) Notice the title change Change-Id: Ifaecf99615d922140e8cd531ab164320de729439 issue-id: CYNGNOS-1168
Diffstat (limited to 'src/com/android/settings/profiles')
-rw-r--r--src/com/android/settings/profiles/SetupActionsFragment.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/com/android/settings/profiles/SetupActionsFragment.java b/src/com/android/settings/profiles/SetupActionsFragment.java
index bcd98be..e9f0076 100644
--- a/src/com/android/settings/profiles/SetupActionsFragment.java
+++ b/src/com/android/settings/profiles/SetupActionsFragment.java
@@ -1046,7 +1046,7 @@ public class SetupActionsFragment extends SettingsPreferenceFragment
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
final Item itemAtPosition = (Item) parent.getItemAtPosition(position);
mSelectedItem = itemAtPosition;
- mLastSelectedPosition = position;
+ mLastSelectedPosition = mAdapter.getPosition(itemAtPosition);
if (itemAtPosition instanceof AirplaneModeItem) {
showDialog(DIALOG_AIRPLANE_MODE);