Currently each time the app is restarted the user has to log in. I would like the app to remember the user until they manually sign out. Below is what I thought would work, but its just bypassing the login activity completely.
@Override
protected void onStart() {
super.onStart();
if(userPool.getCurrentUser() != null){
Intent intent = new Intent(LoginActivity.this, MainActivity.class);
finish();
startActivity(intent);
}
}
So, userPool.getcurrentUser()
must not be null in the beginning, even though I don't create a CognitoUser object until after the login button is clicked.
Thanks for your help.