开发者

A Way to kill an activity in Android

开发者 https://www.devze.com 2022-12-13 09:54 出处:网络
In my android application, I start another activity using \'startActivity\'. Is there anyway for me to kill that activity I sta开发者_StackOverflowrted?

In my android application, I start another activity using 'startActivity'. Is there anyway for me to kill that activity I sta开发者_StackOverflowrted?

Thank you.


You can stop the other activity by calling Activity.finish(). Alternatively, you can use Activity.finishActivity() to finish an activity started by startActivityForResult().


When you start the new activity, the old activity goes onPause(). you could try calling finish() in the onPause() of the old activity.

0

精彩评论

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