I am developing an application that, in the event of a failure, should retain some data with the time of the failure. Now I save the data in onDestroy () as follows:
@Override protected void onDestroy() { saveState(); super.onDestroy(); }
But whenever I break my application on purpose, onDestroy () is not called and my data is not saved.
My question is, how can I save my data on a crash? Which approach should I take? Because I need a breakdown time so that it is also saved, it is mandatory.
source share