diff options
author | Amith Yamasani <yamasani@google.com> | 2012-10-09 17:13:33 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-10-10 10:31:59 -0700 |
commit | 7f2824b924775e78192fb12c342b38558cf304b5 (patch) | |
tree | f28d7ebf0749e45394957c846e2188cc9aef6da5 /src | |
parent | a92f380f866be566d2f47ffa14ade81e6551ca56 (diff) | |
parent | ef6172304b08195b2e5ac751c9816d43323f448e (diff) | |
download | packages_apps_settings-7f2824b924775e78192fb12c342b38558cf304b5.zip packages_apps_settings-7f2824b924775e78192fb12c342b38558cf304b5.tar.gz packages_apps_settings-7f2824b924775e78192fb12c342b38558cf304b5.tar.bz2 |
Merge "Go back to top of list when Settings is relaunched" into jb-mr1-dev
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/Settings.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/com/android/settings/Settings.java b/src/com/android/settings/Settings.java index 9c7f848..b52c2e2 100644 --- a/src/com/android/settings/Settings.java +++ b/src/com/android/settings/Settings.java @@ -271,9 +271,11 @@ public class Settings extends PreferenceActivity super.onNewIntent(intent); // If it is not launched from history, then reset to top-level - if ((intent.getFlags() & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) == 0 - && mFirstHeader != null && !onIsHidingHeaders() && onIsMultiPane()) { - switchToHeaderLocal(mFirstHeader); + if ((intent.getFlags() & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) == 0) { + if (mFirstHeader != null && !onIsHidingHeaders() && onIsMultiPane()) { + switchToHeaderLocal(mFirstHeader); + } + getListView().setSelectionFromTop(0, 0); } } @@ -282,7 +284,9 @@ public class Settings extends PreferenceActivity Integer index = mHeaderIndexMap.get(id); if (index != null) { getListView().setItemChecked(index, true); - getListView().smoothScrollToPosition(index); + if (isMultiPane()) { + getListView().smoothScrollToPosition(index); + } } } } |