Check if the Activity is finishing before showDialog()
Check if the Activity is going through its finishing phase before displaying the Dialog, because Showing dialog once the activity is no longer in context will cause BadTokenException. Change-Id: I58940e694f61cd79536abe2df60a0b745a7b806f
This commit is contained in:
@@ -112,7 +112,8 @@ public class AccountSyncSettings extends AccountPreferenceBase {
|
|||||||
} catch (AuthenticatorException e) {
|
} catch (AuthenticatorException e) {
|
||||||
// handled below
|
// handled below
|
||||||
}
|
}
|
||||||
if (failed) {
|
if (failed && getActivity() != null &&
|
||||||
|
!getActivity().isFinishing()) {
|
||||||
showDialog(FAILED_REMOVAL_DIALOG);
|
showDialog(FAILED_REMOVAL_DIALOG);
|
||||||
} else {
|
} else {
|
||||||
finish();
|
finish();
|
||||||
|
Reference in New Issue
Block a user