Ideal way to cancel an executing AsyncTask

Posted by Samuh on Stack Overflow See other posts from Stack Overflow or by Samuh
Published on 2010-04-29T06:08:09Z Indexed on 2010/04/29 6:37 UTC
Read the original article Hit count: 373

Filed under:
|
|

I am running remote audio-file-fetching and audio file playback operations in a background thread using AsyncTask. A Cancellable progress bar is shown for the time the fetch operation runs.

I want to cancel/abort the AsyncTask run when the user cancels (decides against) the operation. What is the ideal way to handle such a case?

© Stack Overflow or respective owner

Related posts about android

Related posts about asynctask