- Notifications
You must be signed in to change notification settings - Fork 2.2k
FileDownloadListener
Jacksgong edited this page Apr 14, 2016 · 1 revision
pending -> started -> connected -> (progress <->progress) -> blockComplete -> completed paused / completed / error / warn blockComplete -> completed | function | description | update |
|---|---|---|
| pending | Pending for download | soFarBytes、totalBytes |
| started | Finish pending, and start the download runnable for the task | - |
| connected | Connected to the remote file server | ETag、IsResumeBreakpoint、 soFarBytes、totalBytes |
| progress | Download progress | soFarBytes |
| blockComplete | Callback before the 'completed callback' sync in the new thread | - |
| retry | Callback before automatically retry download | Throwable、RetryingTimes、soFarBytes |
| completed | Succeed download and completed | - |
| paused | Paused download and over | soFarBytes |
| error | Occur error and over | Throwable |
| warn | There is already an identical task(same url & same path) being downloaded(pending/connected/process/retry) | - |

Your have 2 ways to handle this problem:
-
FileDownloader#enableAvoidDropFrame, The default is enabled. -
BaseDownloadTask#setSyncCallback, The default is false, if true will invoke callbacks of FileDownloadListener directly on the download thread(do not post the message to the ui thread).
- Initialization
- Start downloading
- Pause or Stop
- Get the internal stored data
- Customizable Component
- Interface