This is not ImageDownloader. You made many modifications.
Put a breakpoint in line 89. You will see that your code is wrong.
You should watch the collections video tutorial and see how to correctly use Maps.
Correct code:
Private Sub ShowImgWhenComplete(ilo As imgldrobj,bmp As Bitmap)
If tasks.ContainsKey(ilo.url) Then
Dim ti As imgldrobj=tasks.Get(ilo.url)
LogColor(ilo.url,Colors.Red)
LogColor(ti.url,Colors.Blue)
If ti.url=ilo.url Then
If ti.cache Then
saveBmpToFile(getkey(ilo.url),bmp)
completeJobFromCache(ti)
Else
completeJobFromNet(ti,bmp)
End If
End If
End If
End Sub
Tip 2: don't use ImageDownloader at all. It is not needed since the support for resumable subs. You can simplify your code:
[B4X] OkHttpUtils2 with Wait For
Tip 3: remove the two modules and use iHttpUtils2 library instead.