Last active
July 20, 2020 10:24
-
-
Save bengongon97/64c1dfb99ff6418d8915fa0574d7d735 to your computer and use it in GitHub Desktop.
onActivityResult in MainActivity for AccountKit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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