Activity weird behaviour

JTmartins

Active Member
Licensed User
Longtime User
Hi, everyone,

Here it goes,

The skeleton is something like this

B4X:
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:

JTmartins

Active Member
Licensed User
Longtime User
So it should be something like

B4X:
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
Top