I share code that is use to execute actvity once
SharedPreferences settings=getSharedPreferences("prefs",0); boolean firstRun=settings.getBoolean("firstRun",false); if(firstRun==false)//if running for first time//Splash will load for first time{SharedPreferences.Editor editor=settings.edit(); editor.putBoolean("registration",true); editor.commit(); Intent a=new Intent(Splash_Activity.this,MainActivity.class); a. addFlags(Intent.FLAG_} else{ Intent a=new Intent(getApplicationContext(),TweenMation_Activity.class); startActivity(a); finish(); }ACTIVITY_CLEAR_TASK| Intent.FL AG_ACTIVITY_NEW_TASK); startActivity(a)
No comments:
Post a Comment