Showing a Form

eww245

Member
Licensed User
Is it possible, on the device, to run an app that's already running?

I would like to set it in the background and then show the form after a command arg starts it back up.
It will only work in the IDE, and complied with a timer set to show the form after hidden.

Also, is there a way to run code triggered by an event wakeup, with the program already running?
I'd like images to update after it wakes up.
I've searched for some code to write a library, but can't find anything other than RunAppAtEvent


Thanks,
E
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Is it possible, on the device, to run an app that's already running?
When you launch a program that already runs, this program will become active and visible. So I think that this default behavior is exactly what you need.

Also, is there a way to run code triggered by an event wakeup, with the program already running?
I'd like images to update after it wakes up.
I've searched for some code to write a library, but can't find anything other than RunAppAtEvent

One possible solution is to use a timer with an interval of about 5 seconds. On each tick compare the current value to the previous one (which was saved in a global variable). If the difference is larger than something like 10 seconds you know that the device was waked up.
 

eww245

Member
Licensed User
Thanks Erel

After some testing I am able to detect that the device woke up.
I got the time down to 100ms and it's pretty accurate on updating the form.

Sometimes it doesn't work at all, I'm guessing because of the current state of my app.
Not a problem, it will get updated in other ways afterwards.

Thanks Again

When you launch a program that already runs, this program will become active and visible. So I think that this default behavior is exactly what you need.



One possible solution is to use a timer with an interval of about 5 seconds. On each tick compare the current value to the previous one (which was saved in a global variable). If the difference is larger than something like 10 seconds you know that the device was waked up.
 
Top