Performing long running operation in onDestroy

前端 未结 2 720
滥情空心
滥情空心 2021-01-18 08:13

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?

If I use

2条回答
  •  心在旅途
    2021-01-18 08:30

    Try to start your thread in onBackPressed() and call destroy() when your thread will be finished.

提交回复
热议问题