I have a Optionsmenu in my Android App, in which is a Button to Go Back to the Apps Dashboad and remove all Activities laying upon that, also removing the History. How is this possible?
thx
Got the Answer:
That’s what does the Trick:
myIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
public boolean onOptionsItemSelected(MenuItem item) {
// Handle item selection
switch (item.getItemId()) {
case R.id.dashboard:
Intent myIntent = new Intent(this, DashBoard.class);
myIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(myIntent);
return true;
default:
return super.onOptionsItemSelected(item);
}
}
That’s what does the Trick:
myIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);