How does cancelling an AsyncTaskLoader work?
Asked Answered
H

0

7

I've noticed the following functions for AsyncTaskLoader,Loader and LoaderManager :

Thing is, I don't get how they work:

  1. What's the difference between them?
  2. Does any of them call "interrupt" on the thread of the loader? If not, is it possible ?
  3. How can the loader halt its operation when those functions get called?
  4. How can the loader cancel itself (since both functions need to run on the UI thread only) ?
  5. Does destroy/reset/abandon a loader also cancels it?
  6. Will "isLoadInBackgroundCanceled" return true even if the loader hasn't started yet?
  7. How can the UI thread know that a loader was cancelled? Should it use "isLoadInBackgroundCanceled" ?
  8. What's the typical thing to do to cancel a loader? to restart a loader? To restart a loader but with different input?
Haemorrhage answered 7/12, 2015 at 0:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.