From 32595464601e7d20eb0283aac5d110a70129d4a2 Mon Sep 17 00:00:00 2001 From: Danesh M Date: Wed, 30 Sep 2015 15:52:08 -0700 Subject: 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 --- src/com/android/settings/profiles/SetupActionsFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/com/android/settings/profiles') 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); -- cgit v1.1