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
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index 72563f6..d25e976 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -413,12 +413,6 @@
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 @@
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 @@
setTitle(mInitialTitle);
Bundle initialArguments = getIntent().getBundleExtra(EXTRA_SHOW_FRAGMENT_ARGUMENTS);
-
switchToFragment( initialFragmentName, initialArguments, true, false,
mInitialTitle, false);
} else {