Is using AsyncTask still recommended for loading listView items in the background?

后端 未结 3 957
感动是毒
感动是毒 2021-02-09 17:55

Background

I\'ve heard that there are some new solutions for loading data in the background which are more recommended than AsyncTask (like loaders).

The prob

3条回答
  •  独厮守ぢ
    2021-02-09 18:30

    Yes.

    Loaders are managed AsyncTasks. If you are not using a Loader, you are probably missing the management that they require.

    AsyncTasks (and Loaders) are a pretty bad way to get stuff that is off the device. To get data from a remote server look into using an IntentService. See: https://www.youtube.com/watch?v=xHXn3Kg2IQE

提交回复
热议问题