how to close android app completely

前端 未结 7 1772
一个人的身影
一个人的身影 2020-12-03 01:59

I created an android application with a logout option in onCreateOptionsMenu. The Logout works perfectly but when I press the back button again it takes me to t

7条回答
  •  感情败类
    2020-12-03 02:13

    For API 21 and up

    finishAndRemoveTask()

    You can call this to close the app completely. All activities will finish() and the app is removed from the task list.

提交回复
热议问题