开发者

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();
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜