I have a login activity with username and password and a checkbox to set stayLoggedIn to true so the user doesn’t have to login again when the app restart.
In the startActivity I check for userToken to skip the loginActivity if userToken is not null
String userToken = UserTokenStorageFactory.instance().getStorage().get()
if( userToken != null && !userToken.equals( "" ) ) {
// user login is available, skip the login activity/login form
Intent goToMain = new Intent(StartActivity.this, MainActivity.class);
startActivity(goToMain);
} else {
Intent goToLogin = new Intent(StartActivity.this, LoginActivity.class);
startActivity(goToLogin);
}
How can I retrieve currentUser if I skip the loginActivity?