Android AsyncTask memory leaks

前端 未结 2 840
失恋的感觉
失恋的感觉 2020-12-11 18:27

I read some questions here, some articles in Internet, but the question about memory leaks in AsyncTask isn\'t clear for me. Please, can you give me an advice?
Let\'s co

2条回答
  •  隐瞒了意图╮
    2020-12-11 18:52

    By the way cancelling an async task doesn't mean that it will immediately be cancelled. I recommend you to switch to Intent Services, Handlers or if possible to RXJava.

    Unlike async tasks where you may need to nest async tasks to execute multiple executions, with RXJava you could chain those executions, apply filters and different transformations and you can run that code on a worker thread.

提交回复
热议问题