返回键调用 system.exit(0) 此方法以后 APP会自动重启。有谁有高见?指导一下。
天蓬老师2017-04-17 17:35:45
There are several situations:
Set up a custom exception handler, then system.exit(0) throws an exception that is caught by the handler, and then the code in the handler reloads the application.
There is a service in the program, and the return value of the service's onStartCommand method is set to START_STICKY. The semantics of this return value is that when the service is killed, restart it. system.exit(0) will kill all threads, including services, and then the system will restart the service according to the START_STICKY setting.