Fix #1930767 : "Share with Google" not working on orientation change.

Discard the dialog after onSaveInstanceState. And check the different
onCreate scenarios before popping up the dialog.
This commit is contained in:
Amith Yamasani
2009-07-13 15:09:46 -07:00
parent fe0b0178cb
commit 5c30845cf3

View File

@@ -150,9 +150,10 @@ public class SecuritySettings extends PreferenceActivity implements
null); null);
mContentQueryMap = new ContentQueryMap(settingsCursor, Settings.System.NAME, true, null); mContentQueryMap = new ContentQueryMap(settingsCursor, Settings.System.NAME, true, null);
mContentQueryMap.addObserver(new SettingsObserver()); mContentQueryMap.addObserver(new SettingsObserver());
boolean doneUseLocation = savedInstanceState != null boolean doneUseLocation = savedInstanceState == null
&& savedInstanceState.getBoolean(KEY_DONE_USE_LOCATION, true); ? false : savedInstanceState.getBoolean(KEY_DONE_USE_LOCATION, true);
if (getIntent().getBooleanExtra("SHOW_USE_LOCATION", false) && !doneUseLocation) { if (!doneUseLocation && (getIntent().getBooleanExtra("SHOW_USE_LOCATION", false)
|| savedInstanceState != null)) {
showUseLocationDialog(true); showUseLocationDialog(true);
} }
@@ -261,12 +262,12 @@ public class SecuritySettings extends PreferenceActivity implements
} }
@Override @Override
public void onPause() { public void onStop() {
if (mUseLocationDialog != null && mUseLocationDialog.isShowing()) { if (mUseLocationDialog != null && mUseLocationDialog.isShowing()) {
mUseLocationDialog.dismiss(); mUseLocationDialog.dismiss();
} }
mUseLocationDialog = null; mUseLocationDialog = null;
super.onPause(); super.onStop();
} }
@Override @Override