How to kill my own Activity - the hard way

后端 未结 8 599
灰色年华
灰色年华 2021-01-31 10:59

So I have my Activity, and on pressing a \"Quit\" button I call Activity.finish(). This effectively closes my application.

The problem: The Dalvik-process of my applicat

8条回答
  •  长发绾君心
    2021-01-31 11:28

    Well, if not only activity, but also the application you want to terminate, you can use

    System.exit(0)

    People say that it's deprecated or bad example, but, well it's pure Java and does work...

提交回复
热议问题