There is a quiz app. As soon as the user’s life ends, he needs to be moved to the new activation of the results, and the old one (with questions) deleted so that he cannot press the back button and continue playing. I call the onDestroy() method, the onDestroy() is deleted, but at the same time, a window pops up on the application with the error "In the application" such and such "an error occurred.". After that, I click "OK" and the application works on correctly. How to remove this pop-up error?

    1 answer 1

    onDestroy does not need to be called independently. You need to call finish , and from the UI thread (UI thread).