How do I finish a task on Android?
I start an activity in a new task and I want to kill the task is when the user leaves it because I think the task is useless when the user leaves.
How can I achieve this on Android? Setting the fi开发者_StackOverflow中文版nishOnTaskLaunch attribute of the root activity has no effect.
You can use the noHistory tag in the manifest , what you can also do is call finish() in onPause for that activity.
make sure your onPause() looks like:
public void onPause(){
super.onPause();
finish();
}
精彩评论