Once the user enter the login credential first time then use SharedPreferences
and set the value to isLogged
to 1
.
Next time when user open the app then check this variable if this variable value is '1' then open the home activity.
SharedPreferences sharedPref = getSharedPreferences("data",MODE_PRIVATE);
int number = sharedPref.getInt("isLogged", 0);
if(number == 0) {
//Open the login activity and set this so that next it value is 1 then this conditin will be false.
SharedPreferences.Editor prefEditor = sharedPref.edit();
prefEditor.putInt("isLogged",1);
prefEditor.commit();
} else {
//Open this Home activity
}