Use sharepreference. I paste the code here .. use it.
Create rule:
SharedPreferences sp=getSharedPreferences("Login", MODE_PRIVATE); SharedPreferences.Editor Ed=sp.edit(); Ed.putString("Unm",Value ); Ed.putString("Psw",Value); Ed.commit();
Get value from Share preference:
SharedPreferences sp1=this.getSharedPreferences("Login", MODE_PRIVATE); String unm=sp1.getString("Unm", null); String pass = sp1.getString("Psw", null);
When the user logs out, you can set the value null to sharedpreference.
Hasmukh
source share