Nam Nguyen
Nam Nguyen

Reputation: 327

How to cancel asynctask from multiple fragments

I have app with multiple fragment.I running asynctask from fragment A and want stop it from fragment B How can I resolve this problem ? enter image description here

enter image description here

Upvotes: 0

Views: 139

Answers (1)

urandom
urandom

Reputation: 1157

I don't think you can use either use AsyncTask or AsyncTaskLoader for that. The easiest solution would probably be to do your download work in an IntentService, and communicate with it from the different activities.

Upvotes: 2

Related Questions