Skip to content

Instantly share code, notes, and snippets.

@bengongon97
Last active July 20, 2020 10:24
Show Gist options
  • Save bengongon97/64c1dfb99ff6418d8915fa0574d7d735 to your computer and use it in GitHub Desktop.
Save bengongon97/64c1dfb99ff6418d8915fa0574d7d735 to your computer and use it in GitHub Desktop.
onActivityResult in MainActivity for AccountKit
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == REQUEST_SIGN_IN_LOGIN) {
HuaweiIdAuthResult result = HuaweiIdAuthAPIManager.HuaweiIdAuthAPIService.parseHuaweiIdFromIntent(data);
if (result != null) {
if (result.isSuccess()) {
// Obtain the authorization result.
//HuaweiIdAuthResult authResult = HuaweiIdAuthAPIManager.HuaweiIdAuthAPIService.parseHuaweiIdFromIntent(data);
Intent i = new Intent(getBaseContext(), MainActivity.class);
startActivity(i);
Toast.makeText(this, "Login successful", Toast.LENGTH_SHORT).show();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment