Android Question Get all jobs in memory to cancel downloads

wimpie3

Well-Known Member
Licensed User
Longtime User
I have a lot of subs launching downloads with OkHTTPUtils2, like this:
B4X:
Dim httpjob As HttpJob
httpjob.Initialize("getImage", Me)
httpjob.GetRequest.Timeout = 5000
httpjob.Download(fileURL)

I don't have a global dim'med HttpJob, but I create a new one for every request.

My question is: how do I cancel all those downloads at once? I don't have a reference to them anymore as they are all individually dimmed inside subs.

Can I loop over all objects in memory somehow, look if they are of the type "httpjob" and cancel the downloads?
 

wimpie3

Well-Known Member
Licensed User
Longtime User
Good idea, but I imagine there must be another way? In VB you can loop over all elements, check what type they are, etc...
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Last edited:
Upvote 0

wimpie3

Well-Known Member
Licensed User
Longtime User
As far as I can see, each download job should have a different name in that lib. That's not what I'm looking for.
 
Upvote 0
Top