Cancelling file download with httpclient and asynctask

前端 未结 3 525
逝去的感伤
逝去的感伤 2021-01-03 00:38

In my app I need to download files from url locations. I want to display progress of the download in a dialogbox (or optionally in the notification area). I\'ve come across

3条回答
  •  清酒与你
    2021-01-03 01:22

    I would call cancel(true) on your AsyncTask object. This will interrupt your thread via normal interruption handling. You then can ask the AsyncTask if it isCancelled().

提交回复
热议问题