From 5cda21b449a56de42f7868bdcdaa31bb6f587c03 Mon Sep 17 00:00:00 2001 From: Fabrice Di Meglio Date: Mon, 21 Apr 2014 10:14:28 -0700 Subject: [PATCH] Search - optimize when updating the Index is done - part 2 - well, fix a regression when launching WiFi / Bluetooth settings from the Quick Settings: we can only get the Intent properties after the call to super.onCreate(...) Change-Id: I21abbee610ad53dd0022c645268e55a6ba31a7b0 --- src/com/android/settings/SettingsActivity.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java index 72563f6469a..d25e97696f9 100644 --- a/src/com/android/settings/SettingsActivity.java +++ b/src/com/android/settings/SettingsActivity.java @@ -413,12 +413,6 @@ public class SettingsActivity extends Activity getWindow().setUiOptions(getIntent().getIntExtra(EXTRA_UI_OPTIONS, 0)); } - final String initialFragmentName = getIntent().getStringExtra(EXTRA_SHOW_FRAGMENT); - - if (initialFragmentName == null) { - Index.getInstance(this).update(); - } - mAuthenticatorHelper = new AuthenticatorHelper(); mAuthenticatorHelper.updateAuthDescriptions(this); mAuthenticatorHelper.onAccountsUpdated(this, null); @@ -441,6 +435,13 @@ public class SettingsActivity extends Activity mDisplayHomeAsUpEnabled = true; + // Getting Intent properties can only be done after the super.onCreate(...) + final String initialFragmentName = getIntent().getStringExtra(EXTRA_SHOW_FRAGMENT); + + if (initialFragmentName == null) { + Index.getInstance(this).update(); + } + if (savedState != null) { // We are restarting from a previous saved state; used that to initialize, instead // of starting fresh. @@ -473,7 +474,6 @@ public class SettingsActivity extends Activity setTitle(mInitialTitle); Bundle initialArguments = getIntent().getBundleExtra(EXTRA_SHOW_FRAGMENT_ARGUMENTS); - switchToFragment( initialFragmentName, initialArguments, true, false, mInitialTitle, false); } else {