How to quit android application programmatically

前端 未结 30 2061
迷失自我
迷失自我 2020-11-22 03:06

I Found some codes for quit an Android application programatically. By calling any one of the following code in onDestroy() will it quit application entirely?

30条回答
  •  不知归路
    2020-11-22 03:31

    @Sivi 's answer closes the app. But on return, if you have some child activities, another unfinished activity might be opened. I added noHistory:true to my activities so the app on return starts from MainActivity.

    
    
    

提交回复
热议问题