while first time login u get something username or userid in respones than store ther username or userid in sharedpreference like as shown below
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(YourActivity.this);
prefs.edit().putInt("userid",userid).commit();
as after succesfull login this will store your userid in preference and u can check u are already login or not as
int Userid;
prefs = PreferenceManager.getDefaultSharedPreferences(YourActivity.this);
Userid= mPrefs.getInt("userid", 0); which will return defalut value 0 if u are not login
after check
if(Userid>0){
// Means u are already logged in do here code what u want if u are login
}else{
// Means u are not logged in than go to your login pageview from here
}
this is just simple way for doing what u want suppose if u want logoout functionality on button click than onclick event u have to add following code for logout which will clear prefernce
prefs = PreferenceManager.getDefaultSharedPreferences(MyAccountActivity.this);
prefs.edit().clear().commit();