I try to show another activity in AppInviteApi.getInvitation
callback.
mGoogleApiClient = new GoogleApiClient.Builder(this)
.enableAutoManage(this , this )
.addApi(AppInvite.API)
.build();
boolean autoLaunchDeepLink = false;
AppInvite.AppInviteApi.getInvitation(mGoogleApiClient, this, autoLaunchDeepLink)
.setResultCallback(
new ResultCallback<AppInviteInvitationResult>() {
@Override
public void onResult(@NonNull AppInviteInvitationResult result) {
if (result.getStatus().isSuccess()) {
Intent intent = result.getInvitationIntent();
String deepLink = AppInviteReferral.getDeepLink(intent);
String[] strings= deepLink.split("\\%");
String key =strings[strings.length-1];
Intent intent2=new Intent(GroupsActivity.this,MainActivity.class);
intent2.putExtra("groupKey",key);
startActivity(intent2);
} else {
}
}
});
After this action, I observe an endless cycle in which consecutive MainActivity and GroupsActivity starts. How to correctly start an another activity in this case?