JTmartins Active Member Licensed User Longtime User Dec 26, 2012 #1 Hi, everyone, Here it goes, The skeleton is something like this Code: Activity 1 job1.poststring StartActivity 2 case job1 ... ... job2.poststring case job2 ... ... ... end select Activity 2 Show HTML table What is hapening, is that the activity one, runs OK. I can see on the DB, that it has done everything I wanted StartActivity 2 is fired. I can see it on the screen. But just for a few seconds, then it comes back to activity 1. There is nothing on the Activity 2, that calls activity 1. Is activity 2 being started before job1 or 2 completes ? I always have troubles with this Job things !!! Any help ? Thanks Last edited: Dec 26, 2012
Hi, everyone, Here it goes, The skeleton is something like this Code: Activity 1 job1.poststring StartActivity 2 case job1 ... ... job2.poststring case job2 ... ... ... end select Activity 2 Show HTML table What is hapening, is that the activity one, runs OK. I can see on the DB, that it has done everything I wanted StartActivity 2 is fired. I can see it on the screen. But just for a few seconds, then it comes back to activity 1. There is nothing on the Activity 2, that calls activity 1. Is activity 2 being started before job1 or 2 completes ? I always have troubles with this Job things !!! Any help ? Thanks
Erel B4X founder Staff member Licensed User Longtime User Dec 27, 2012 #2 The activity is restarted from the CallSubdelayed call in HttpJob. The solution in your case is to use a service to manage the HttpJobs. Upvote 0
The activity is restarted from the CallSubdelayed call in HttpJob. The solution in your case is to use a service to manage the HttpJobs.
JTmartins Active Member Licensed User Longtime User Dec 27, 2012 #3 So it should be something like Code: Activity 1 Sub Activity_Create .... startservice (webjobs) startactivity 2 End Sub .... Activity 2 ... and in service webjobs, I would move all the code that was previously in activity 1, having in consideration the correct places for the variables. In that way startactivity 2 is only run after the service finishes ?, or do I need anything else to control if service has ended ? After use it can actually be destroyed, as I do not need it again in the app. I'm still trying to understand the android way :sign0104: Upvote 0
So it should be something like Code: Activity 1 Sub Activity_Create .... startservice (webjobs) startactivity 2 End Sub .... Activity 2 ... and in service webjobs, I would move all the code that was previously in activity 1, having in consideration the correct places for the variables. In that way startactivity 2 is only run after the service finishes ?, or do I need anything else to control if service has ended ? After use it can actually be destroyed, as I do not need it again in the app. I'm still trying to understand the android way :sign0104:
Erel B4X founder Staff member Licensed User Longtime User Dec 27, 2012 #4 Http requests are handled in the background. When the request completes the activity with the JobDone event is called with CallSubDelayed. The result is that the activity is resumed. The solution is to move all the communication code to a service. Upvote 0
Http requests are handled in the background. When the request completes the activity with the JobDone event is called with CallSubDelayed. The result is that the activity is resumed. The solution is to move all the communication code to a service.