I have a \"long-running\" cleanup operation that I need to perform in onDestroy() of my Activity. What is the best way to do this?
onDestroy()
Activity
If I use
Try to start your thread in onBackPressed() and call destroy() when your thread will be finished.
onBackPressed()
destroy()