W
W
Web__Nikita032019-12-29 18:30:50
Android
Web__Nikita03, 2019-12-29 18:30:50

How to organize the work of Loader?

I understand that onCreateLoader() , onLoadFinished, onLoaderReset() should be implemented in the callback. But what about the loader itself? In the constructor, you need to unpack the Bundle. In the onStartLoading() method, you need to check if there is a result, and if it is present, call deliverResult(), otherwise forceLoad(). But where to perform the actual download of something. I have seen loading implementations in onForceLoad() and doInBackground(). Where is the best place to do it? And am I going to organize the Loader correctly?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question