How to close Android application?

后端 未结 22 1225
小蘑菇
小蘑菇 2020-11-22 07:17

I want to close my application, so that it no longer runs in the background.

How to do that? Is this good practice on Android platform?

If I rely on the \"ba

22条回答
  •  花落未央
    2020-11-22 08:16

    Use of finishAffinity() may be an good option if you want to close all Activity of the app. As per the Android Docs-

    Finish this activity as well as all activities immediately below it in the current task that have the same affinity.
    

提交回复
热议问题