Android Question Prevent run JobDone event

devmobile

Active Member
Licensed User
Hello
I use httputil in my project
When i use it in Activity A and goto activity B,it return to Activity A auto
Why?
I dont need to return to previous activity when it is pause
 

DonManfred

Expert
Licensed User
Longtime User
JobDone is raised in the Module which starts the Download. If you atart it in ActA it will return in ActA.

You can use a Service, do all the Communication in this service. And in JobDone (in the service) you can send the Result to the Activity if it is already in foreground.
Or even to ignore the result if you switched the Activity in the meantime.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
JobDone is raised in the Module which starts the Download.
Small clarification. You can choose where the event will be raised:
B4X:
Dim j As HttpJob
J.Initialize("name", Me) 'the second parameter can be a different module

As you wrote, a service should be used instead of an Activity. The starter service is a good option.
 
Upvote 0
Top