Close application and launch home screen on Android

后端 未结 21 2029
我在风中等你
我在风中等你 2020-11-22 07:33

I have two different activities. The first launches the second one. In the second activity, I call System.exit(0) in order to force the application to close, bu

21条回答
  •  自闭症患者
    2020-11-22 08:11

    Keep in mind that when working with applications that use persistent socket connections, the finish() method does not release the connection. Under normal circumstances, finish() is the best option, but if you absolutely need to exit an app and release all resource it's using then use killProcess. I've had no problems using it.

提交回复
热议问题