Merge "Remove unnecessary EmailAsyncTask"
This commit is contained in:
commit
b8f672465a
@ -383,30 +383,19 @@ public class EmailActivity extends Activity implements View.OnClickListener, Fra
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Connection error; show the error message banner
|
||||
new EmailAsyncTask<Void, Void, String>(mTaskTracker) {
|
||||
@Override
|
||||
protected String doInBackground(Void... params) {
|
||||
Account account =
|
||||
Account.restoreAccountWithId(EmailActivity.this, accountId);
|
||||
return (account == null) ? null : account.mDisplayName;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSuccess(String accountName) {
|
||||
Account account = Account.restoreAccountWithId(EmailActivity.this, accountId);
|
||||
if (account == null) return;
|
||||
String message =
|
||||
MessagingExceptionStrings.getErrorString(EmailActivity.this, result);
|
||||
if (!TextUtils.isEmpty(accountName)) {
|
||||
if (!TextUtils.isEmpty(account.mDisplayName)) {
|
||||
// TODO Use properly designed layout. Don't just concatenate strings;
|
||||
// which is generally poor for I18N.
|
||||
message = message + " (" + accountName + ")";
|
||||
message = message + " (" + account.mDisplayName + ")";
|
||||
}
|
||||
if (mErrorBanner.show(message)) {
|
||||
mLastErrorAccountId = accountId;
|
||||
}
|
||||
}
|
||||
}.executeParallel();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user