When User click "Exit" button, Its go to device home screen.Then again click/select my application its go to last opened activity.I houldn't go there.It need to go initial screen.How we can implement this.I have done using :
public void onExitAction(View botton){
SharedPreferences myPrefs = this.getSharedPreferences("myLogedPrefs",MODE_WORLD_READABLE);
myPrefs.edit().remove("myLogedPrefs");
myPrefs.edit().clear();
myPrefs.edit().commit();
Intent startMain = new Intent(Intent.ACTION_MAIN);
startMain.addCategory(Intent.CATEGORY_HOME);
startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(startMain);
finish();
}
Please help me..
Thanks in advance