Skip to content

Instantly share code, notes, and snippets.

@melikeeroglu
Created September 30, 2020 06:12
Show Gist options
  • Save melikeeroglu/29556798a9833e166199404fdf5b3032 to your computer and use it in GitHub Desktop.
Save melikeeroglu/29556798a9833e166199404fdf5b3032 to your computer and use it in GitHub Desktop.
HiAnimals onActivityResult
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 1001) {
Task<AuthHuaweiId> authHuaweiIdTask = HuaweiIdAuthManager.parseAuthResultFromIntent(data);
if (authHuaweiIdTask.isSuccessful()) {
AuthHuaweiId huaweiAccount = authHuaweiIdTask.getResult();
Log.i(TAG, "signIn success Access Token = " + huaweiAccount.getAccessToken());
Log.i(TAG, "signIn success User Name = " + huaweiAccount.getDisplayName());
}
else {
Log.i(TAG, "signIn failed: " + ((ApiException) authHuaweiIdTask.getException()).getStatusCode());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment