Android: Show toast after finishing application / activity
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to show a simple toast, when exiting an application. The problem is, that the toast is not shown. I assume it is because the acitivity is finished or because of System.exit(0) , but I don't know how to solve it. Does anyone have a tip? Thanks!! In my activity I have the following code: Toast.makeText(this,"Exit application.",Toast.LENGTH_SHORT).show(); exitApp(); public void exitApp (){ App.getInstance().exit(); finish(); } And the mehod exit in App: public void exit() { System.exit(0); } 回答1: It is advisable that you call finish to