Android Question Sticky service

tigrot

Well-Known Member
Licensed User
Longtime User
Hi everybody,
I have the need to keep a service responsive also if it's not running in foreground.
I have put my code in STARTER service and marked it with :
B4X:
#StartCommandReturnValue: android.app.Service.START_STICKY.
When the user choses to terminate the App, I terminate main.activity and leave Starter active.
If the phone goes sleep and I start again using the icon, the starter service starts, but main activity doesn't. With no sticky label seems to run properly.
Is using STARTER sticky the correct aproach to my need of keep it running?

Thank you
Mauro
 
Last edited:
Top