Skip to content

Commit

Permalink
replace with lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
niyatim23 committed Apr 9, 2024
1 parent 446a9a2 commit 5a297b1
Showing 1 changed file with 23 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,36 +30,30 @@ protected void onCreate(Bundle savedInstanceState) {
final AppCompatActivity thisActivity = this;
supportFinishAfterTransition();

AsyncTask.execute(new Runnable() {
@Override
public void run() {
if (auth.isSignedIn()) {
ActivityUtils.startActivity(thisActivity, SimpleNavActivity.class);
} else {
auth.showSignIn(thisActivity,
SignInUIOptions.builder()
.logo(R.mipmap.kinesisvideo_logo)
.backgroundColor(Color.WHITE)
.nextActivity(SimpleNavActivity.class)
.build(),
new Callback<UserStateDetails>() {
@Override
public void onResult(UserStateDetails result) {
Log.d(TAG, "onResult: User signed-in " + result.getUserState());
}
AsyncTask.execute(() -> {
if (auth.isSignedIn()) {
ActivityUtils.startActivity(thisActivity, SimpleNavActivity.class);
} else {
auth.showSignIn(thisActivity,
SignInUIOptions.builder()
.logo(R.mipmap.kinesisvideo_logo)
.backgroundColor(Color.WHITE)
.nextActivity(SimpleNavActivity.class)
.build(),
new Callback<UserStateDetails>() {
@Override
public void onResult(UserStateDetails result) {
Log.d(TAG, "onResult: User signed-in " + result.getUserState());
}

@Override
public void onError(final Exception e) {
runOnUiThread(new Runnable() {
@Override
public void run() {
Log.e(TAG, "onError: User sign-in error", e);
Toast.makeText(StartUpActivity.this, "User sign-in error: " + e.getMessage(), Toast.LENGTH_LONG).show();
}
});
}
});
}
@Override
public void onError(final Exception e) {
runOnUiThread(() -> {
Log.e(TAG, "onError: User sign-in error", e);
Toast.makeText(StartUpActivity.this, "User sign-in error: " + e.getMessage(), Toast.LENGTH_LONG).show();
});
}
});
}
});
}
Expand Down

0 comments on commit 5a297b1

Please sign in to comment.