stop() method will be called when App crashes in CN1

Multi tool use
stop() method will be called when App crashes in CN1
I would like to close the threads or clear cache if the App crashes or Phone switch off or some other abrupt actions. Please advise if this method only gets called when the user kill the App or Signout from the App.
1 Answer
1
I'm pretty sure stop() gets called when you force kill the app, switch apps, lock the screen, phone auto locks, or anything really where the app is no longer visible.
You can also check edge cases by connecting your Android (in dev mode) to your laptop, downloading platform-tools (logcat), adding a print statement inside the stop() function and using the following command "./adb logcat -s "System.out" inside the platform-tools directory. Not sure how to do it on iOS.
stop()
might not be called in a crash. destory
should be called when the app exits completely but neither one is guaranteed for a crash. But neither one of those is necessary for this. Doing cleanup on a crash is redundant as the app will exit completely and clean things... If you want to delete files delete them on the next startup.– Shai Almog
2 days ago
stop()
destory
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Thanks Nick. But I would like to know will this gets called mainly when App Crash for any reason. I will not be able to re- produce it on my device.
– Chris L
Jun 30 at 23:00