So I have to download a bunch of image files from a server and I'm using Priority-Job-Queue. So far seems to works fine and I'm using a simple AsyncTask
for the downloading part.
Since I want the images to be downloaded no matter what I only added RetryConstraint.RETRY
on shouldReRunOnThrowable()
callback. I have also added android.permission.RECEIVE_BOOT_COMPLETED
permission on Manifest.xml
Is this the right/best way so if there's any kind of problem and some images aren't downloaded due to an error, job-queue will try to download them again and again until the job is finished with success ?
Thanks!
@Override
protected RetryConstraint shouldReRunOnThrowable(@NonNull Throwable throwable, int runCount, int maxRunCount) {
return RetryConstraint.RETRY;
}