Android Question [B4A 3.8] How intercept value into Service Module?

erosmax

Well-Known Member
Licensed User
Longtime User
Hi, I've create a Widget and I need to get the value when it return (after standby) from a screen lock.
In short, to understand, as Action_Resume
I would need to make the controls and setting, when returning from standby mode only or return from a Main.
.It's possible? Whay is the Sub into Service?
And It's possible insert a modellable text into Widget (this is my App video o and I wont insert a text https://www.youtube.com/watch?v=dqDo7Ni2RfY)

Thanks you

Ps:It's allgraphics (one image only)...no text :(
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
This question has nothing to do with B4A 3.8. It is exactly the same as in any other version.

The widget is not updated automatically when the screen is unlocked. You can use PhoneEvents to listen to the UserPresent event. However you will only be able to handle this event when your process is running. You can make your service a sticky service or a foreground service.
 
Upvote 0

erosmax

Well-Known Member
Licensed User
Longtime User
Ok, thanks Erel.
 
Upvote 0

erosmax

Well-Known Member
Licensed User
Longtime User
Unfortunately I not have solved. I also tried with ScreenOn and ScreenOFF, but if I/User close the Activity manually (by dragging in the panel phone), this are blocking processes and remains the only Widget opended. It's possible , close a Widget when I close the Activity manually ( not to code)?

So, I've a Activity start (whenlaunch the widget); the Service Modele (my widget) and a Second Activity (my menu).

The problem is this Secon Activity. When it closed Manually, I wont terminate a widget...it's possible?

Thanks
 
Upvote 0
Top