Show UI on retrieveRtToken() error

This commit is contained in:
Hattshire 2018-02-01 02:38:02 -03:00 committed by Marvin W
parent 908c20ccc2
commit f1cdb48a28

View File

@ -144,6 +144,9 @@ public class LoginActivity extends AssistantActivity {
state++; state++;
if (state == 1) { if (state == 1) {
init(); init();
} else if (state == -1) {
setResult(RESULT_CANCELED);
finish();
} }
} }
@ -305,11 +308,15 @@ public class LoginActivity extends AssistantActivity {
retrieveGmsToken(account); retrieveGmsToken(account);
setResult(RESULT_OK); setResult(RESULT_OK);
} else { } else {
showError(R.string.auth_general_error_desc);
Log.w(TAG, "Account NOT created!"); Log.w(TAG, "Account NOT created!");
setResult(RESULT_CANCELED); runOnUiThread(new Runnable() {
// TODO: Give the user a chance to read the message :) @Override
finish(); public void run() {
showError(R.string.auth_general_error_desc);
setNextButtonText(android.R.string.ok);
}
});
state = -2;
} }
} }