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:
@@ -688,7 +688,7 @@ public class VpnSettings extends SettingsPreferenceFragment
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void startVpnTypeSelection() {
|
private void startVpnTypeSelection() {
|
||||||
if (getActivity() == null) return;
|
if ((getActivity() == null) || isRemoving()) return;
|
||||||
|
|
||||||
((PreferenceActivity) getActivity()).startPreferencePanel(
|
((PreferenceActivity) getActivity()).startPreferencePanel(
|
||||||
VpnTypeSelection.class.getCanonicalName(), null, R.string.vpn_type_title, null,
|
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) {
|
private void startVpnEditor(final VpnProfile profile, boolean add) {
|
||||||
if (getActivity() == null) return;
|
if ((getActivity() == null) || isRemoving()) return;
|
||||||
|
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
args.putParcelable(KEY_VPN_PROFILE, profile);
|
args.putParcelable(KEY_VPN_PROFILE, profile);
|
||||||
|
Reference in New Issue
Block a user