-
Notifications
You must be signed in to change notification settings - Fork 777
Task start and cancel
Jacksgong edited this page Apr 4, 2018
·
1 revision
task = new DownloadTask.Builder(url, parentFile)
.setFilename(filename)
// the minimal interval millisecond for callback progress
.setMinIntervalMillisCallbackProcess(30)
// do re-download even if the task has already been completed in the past.
.setPassIfAlreadyCompleted(false)
.build();
task.enqueue(listener);
// cancel
task.cancel();
// This method is optimize specially for bunch of tasks
DownloadTask.enqueue(tasks, listener);
// cancel, this method is also optmize specially for bunch of tasks
DownloadTask.cancel(tasks);