Android: Alternatives to AsyncTask?

前端 未结 7 2171
感动是毒
感动是毒 2020-12-16 13:58

for my app I made a framework for all network calls to an external API. I put everything in \"Services\" like: UserService, MessageService etc. So

相关标签:
7条回答
  • 2020-12-16 14:42

    If you dont prefer third party libraries and prefer library with simplicity and good documentation and support, Loaders is the best choice.

    For our delight, AsyncTaskLoader(subclass of Loaders) performs the same function as the AsyncTask, but better and also can handle Activity configuration changes more easily.And best thing is it behaves within the life cycles of Fragments and Activities.

    For more information and subclasses please check this documentation.

    0 讨论(0)
提交回复
热议问题