From 3661b62c99cf4db620043d8189d004ffa7f84c41 Mon Sep 17 00:00:00 2001 From: Gilles Debunne Date: Mon, 27 Jun 2011 11:19:16 -0700 Subject: [PATCH] Bug 4950070: correct title in Settings isMultiPane does not seem to be adequate for these tests. It actually may have to be changed... Change-Id: I23ddca31bb0324c1473f1a7048db3d6271583414 --- src/com/android/settings/Settings.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/com/android/settings/Settings.java b/src/com/android/settings/Settings.java index f07d965eaf3..bca5e46c1b3 100644 --- a/src/com/android/settings/Settings.java +++ b/src/com/android/settings/Settings.java @@ -81,7 +81,7 @@ public class Settings extends PreferenceActivity implements ButtonBarHandler { super.onCreate(savedInstanceState); mInLocalHeaderSwitch = false; - if (isMultiPane()) { + if (!onIsHidingHeaders() && onIsMultiPane()) { highlightHeader(); // Force the title so that it doesn't get overridden by a direct launch of // a specific settings screen. @@ -193,7 +193,7 @@ public class Settings extends PreferenceActivity implements ButtonBarHandler { // If it is not launched from history, then reset to top-level if ((intent.getFlags() & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) == 0 - && mFirstHeader != null && isMultiPane()) { + && mFirstHeader != null && !onIsHidingHeaders() && onIsMultiPane()) { switchToHeaderLocal(mFirstHeader); } } @@ -211,7 +211,9 @@ public class Settings extends PreferenceActivity implements ButtonBarHandler { public Intent getIntent() { Intent superIntent = super.getIntent(); String startingFragment = getStartingFragmentClass(superIntent); - if (startingFragment != null && !isMultiPane()) { + // This is called from super.onCreate, isMultiPane() is not yet reliable + // Do not use onIsHidingHeaders either, which relies itself on this method + if (startingFragment != null && !onIsMultiPane()) { Intent modIntent = new Intent(superIntent); modIntent.putExtra(EXTRA_SHOW_FRAGMENT, startingFragment); Bundle args = superIntent.getExtras();