Go back to top of list when Settings is relaunched
Also fixes slight movements when coming back from Add account. Bug: 7312513 Bug: 7318452 Change-Id: I5b07262de52e6bdf98e75fff98a032afd74fc0e5
This commit is contained in:
@@ -271,10 +271,12 @@ public class Settings extends PreferenceActivity
|
|||||||
super.onNewIntent(intent);
|
super.onNewIntent(intent);
|
||||||
|
|
||||||
// If it is not launched from history, then reset to top-level
|
// If it is not launched from history, then reset to top-level
|
||||||
if ((intent.getFlags() & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) == 0
|
if ((intent.getFlags() & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) == 0) {
|
||||||
&& mFirstHeader != null && !onIsHidingHeaders() && onIsMultiPane()) {
|
if (mFirstHeader != null && !onIsHidingHeaders() && onIsMultiPane()) {
|
||||||
switchToHeaderLocal(mFirstHeader);
|
switchToHeaderLocal(mFirstHeader);
|
||||||
}
|
}
|
||||||
|
getListView().setSelectionFromTop(0, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void highlightHeader(int id) {
|
private void highlightHeader(int id) {
|
||||||
@@ -282,10 +284,12 @@ public class Settings extends PreferenceActivity
|
|||||||
Integer index = mHeaderIndexMap.get(id);
|
Integer index = mHeaderIndexMap.get(id);
|
||||||
if (index != null) {
|
if (index != null) {
|
||||||
getListView().setItemChecked(index, true);
|
getListView().setItemChecked(index, true);
|
||||||
|
if (isMultiPane()) {
|
||||||
getListView().smoothScrollToPosition(index);
|
getListView().smoothScrollToPosition(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Intent getIntent() {
|
public Intent getIntent() {
|
||||||
|
Reference in New Issue
Block a user