Android Question Activity change error with HttpJob

Carles Escudé

Member
Licensed User
Longtime User
Hello,

I have an application using HttpJob and sometimes when I change the activity while it is receiving data it returns to the previuous activity:

1. On Activity A I ask for some data to the server.
2. Then, while the data has not yet come I change to the Activity B
3. Sometimes It begin to change between activities A and B (A-B-A-B-A-B-A-.....) without stopping.

Is there some method to stop all HttpJob's runnig on one activity?

Thanks
 

RandomCoder

Well-Known Member
Licensed User
Longtime User
The best approach is to use a Service Module to run the Http requests in. Within the service you will need to decide what to do when the JobDone event fires. Maybe use a Process Global Variable to store which Activity to call? Maybe you do not need to call any Activity at all but just require some info updating from the Http request? It is difficult to advise further not knowing more about the intended purpose of your App.
 
Upvote 0
Top