Merge "Fix crash when removing an account." into jb-dev
diff --git a/src/com/android/settings/accounts/AccountSyncSettings.java b/src/com/android/settings/accounts/AccountSyncSettings.java
index 4d9f80e..fda2eb1 100644
--- a/src/com/android/settings/accounts/AccountSyncSettings.java
+++ b/src/com/android/settings/accounts/AccountSyncSettings.java
@@ -98,6 +98,10 @@
.removeAccount(mAccount,
new AccountManagerCallback<Boolean>() {
public void run(AccountManagerFuture<Boolean> future) {
+ // If already out of this screen, don't proceed.
+ if (!AccountSyncSettings.this.isResumed()) {
+ return;
+ }
boolean failed = true;
try {
if (future.getResult() == true) {