One time login like Whatsapp
1. Write these before OnCreate method
SharedPreferences sharedpreferences;
public static final String mypreference = "mypref";
String login_user="";
//get
sharedpreferences = getSharedPreferences(mypreference,
Context.MODE_PRIVATE);
SharedPreferences.Editor
editor = sharedpreferences.edit();
login_user=sharedpreferences.getString("LOGGED_IN_AS",
"");
editor.commit(); // commit changes
if (login_user.equals("1")){startActivity(new Intent(this,Dashboard.class));finish();}
//Put
sharedpreferences = getSharedPreferences(mypreference,
Context.MODE_MULTI_PROCESS);
SharedPreferences.Editor
editor = sharedpreferences.edit(); //deb done code for one time login
editor.putString("LOGGED_IN_AS",
"1");
editor.commit();
check it out
ReplyDeletedrafting tables michaels
drafting tables ikea
drafting tables edmonton
best drafting tables