Android Question HTTPJob - wait for complete

nlpke

New Member
Licensed User
Hi,

my App executes some GET-Requests over the Httputils2 Library. I want my app to continue only after each job is completed.
For example, I start job1 using job1.download("myurl"). The whole programm should then only continue if the jobdone event has been raised successfully, so my app needs to wait for the job to be completed.
I already tried the following:
Before executing the request, a variable called "httpstatus" is set to false. At the end of the JobDone Event it is set to true. By using a Do-While Loop the programm should wait until the "httpstatus" variable turns true, but that ended up in an endless loop.

Thank you for any help
 

Myr0n

Active Member
Licensed User
Longtime User
You can use CallSubDelayed at the end of the JobDone Sub, just after your job is done the sub that you specified in CallSubDelayed should be called if you want more information click here please.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Never try to hold the main thread. It will not work.

I don't think that CallSubDelayed is relevant here.

Show a progress dialog with ProgressDialogShow2. Send all the jobs and also add them to a Map with the job name as a key.

Remove the finished jobs in JobDone. When the map is empty you can hide the progress dialog and continue the program flow.
 
Upvote 0
Top