Skip to content

Commit

Permalink
Show UI on retrieveRtToken() error
Browse files Browse the repository at this point in the history
  • Loading branch information
Hattshire authored and mar-v-in committed Apr 1, 2018
1 parent 908c20c commit f1cdb48
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ protected void onNextButtonClicked() {
state++;
if (state == 1) {
init();
} else if (state == -1) {
setResult(RESULT_CANCELED);
finish();
}
}

Expand Down Expand Up @@ -305,11 +308,15 @@ public void onResponse(AuthResponse response) {
retrieveGmsToken(account);
setResult(RESULT_OK);
} else {
showError(R.string.auth_general_error_desc);
Log.w(TAG, "Account NOT created!");
setResult(RESULT_CANCELED);
// TODO: Give the user a chance to read the message :)
finish();
runOnUiThread(new Runnable() {
@Override
public void run() {
showError(R.string.auth_general_error_desc);
setNextButtonText(android.R.string.ok);
}
});
state = -2;
}
}

Expand Down

0 comments on commit f1cdb48

Please sign in to comment.