Concern
People have been suggesting on SO
that don't use System.exit
for closing the app.
Problem
When user opens the app from history, and when the process of app is destroyed by the OS, and user tries to open the app from history, it crashes.
Solution, i tried
Added a check in base class, that checks if app process is killed, then call System.exit(0)
, this will restart the application, hence no crash will happen and everything will run smooth.
Questions
My app has background services, that sends me user lat/lng after specified time, will system.exit(0) effect that background service?
System.exit(0)
just works fine for me, i tried calling finish()
, but it causes crash, so the only solution for me is using system.exit(0)
It is not recommended approach for using System.exit(0)
in android, right?