Fix the crash when home button is pressed.

When the fragment is going to be removed, we should ignore the events
left in the message queue.

bug:3392087
Change-Id: Ie716c9cc6742e9990c08d1428f10a956a727d6ed
This commit is contained in:
Chung-yih Wang
2011-01-26 17:25:11 +08:00
parent 0dcdcd76ef
commit 5b9408898d

View File

@@ -688,7 +688,7 @@ public class VpnSettings extends SettingsPreferenceFragment
}
private void startVpnTypeSelection() {
if (getActivity() == null) return;
if ((getActivity() == null) || isRemoving()) return;
((PreferenceActivity) getActivity()).startPreferencePanel(
VpnTypeSelection.class.getCanonicalName(), null, R.string.vpn_type_title, null,
@@ -743,7 +743,7 @@ public class VpnSettings extends SettingsPreferenceFragment
}
private void startVpnEditor(final VpnProfile profile, boolean add) {
if (getActivity() == null) return;
if ((getActivity() == null) || isRemoving()) return;
Bundle args = new Bundle();
args.putParcelable(KEY_VPN_PROFILE, profile);