I am checking all these at splashscreen
activity,
So I am giving this,
SharedPreferences spf = getSharedPreferences("myprfs", Context.MODE_PRIVATE);
SharedPreferences.Editor spe = spf.edit();
String name = spf.getString("name","");
String id = spf.getString("id","");
String class = spf.getString("class","");
String roll = spf.getString("roll","");
spe.commit();
if((spe != null) && (name != null) && (id != null) && (class != null) && (roll != null)){
Intent i = new Intent(Startpage.this,Welcome.class);
startActivity(i);
Startpage.this.finish();
}
else{
Intent i = new Intent(Startpage.this,MainActivity.class);
startActivity(i);
Startpage.this.finish();
}
when I open app startup page directly moves to welcome page,
but I want to move splashscreen
page to MainActivity
when there is no values saved in shared-preferences
I followed this to get shared-preference values
can any one suggest me how to give condition in this kind