Merge commit 'bd9f4ab329b4d01493c84b3d93d678c9d5a594fe' into kraken * commit 'bd9f4ab329b4d01493c84b3d93d678c9d5a594fe': Improve handling of UI reset cases
This commit is contained in:
commit
16fa3af652
@ -40,8 +40,14 @@ import android.os.Bundle;
|
||||
*/
|
||||
public class Welcome extends Activity {
|
||||
|
||||
/**
|
||||
* Launch this activity. Note: It's assumed that this activity is only called as a means to
|
||||
* 'reset' the UI state; Because of this, it is always launched with FLAG_ACTIVITY_CLEAR_TOP,
|
||||
* which will drop any other activities on the stack (e.g. AccountFolderList or MessageList).
|
||||
*/
|
||||
public static void actionStart(Activity fromActivity) {
|
||||
Intent i = new Intent(fromActivity, Welcome.class);
|
||||
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
fromActivity.startActivity(i);
|
||||
}
|
||||
|
||||
|
@ -94,10 +94,7 @@ public class AccountSetupNames extends Activity implements OnClickListener {
|
||||
mAccount = EmailContent.Account.restoreAccountWithId(this, accountId);
|
||||
// Shouldn't happen, but it could
|
||||
if (mAccount == null) {
|
||||
// The safe thing to do here is to rewind all the way to the entry activity,
|
||||
// which can handle any configuration of accounts (0, 1, or 2+)
|
||||
Welcome.actionStart(this);
|
||||
finish();
|
||||
onBackPressed();
|
||||
return;
|
||||
}
|
||||
// Get the hostAuth for receiving
|
||||
@ -153,7 +150,13 @@ public class AccountSetupNames extends Activity implements OnClickListener {
|
||||
if (easFlowMode) {
|
||||
AccountSetupBasics.actionAccountCreateFinishedEas(this);
|
||||
} else {
|
||||
AccountSetupBasics.actionAccountCreateFinished(this, mAccount.mId);
|
||||
if (mAccount != null) {
|
||||
AccountSetupBasics.actionAccountCreateFinished(this, mAccount.mId);
|
||||
} else {
|
||||
// Safety check here; If mAccount is null (due to external issues or bugs)
|
||||
// just rewind back to Welcome, which can handle any configuration of accounts
|
||||
Welcome.actionStart(this);
|
||||
}
|
||||
}
|
||||
finish();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user