tigrot Well-Known Member Licensed User Longtime User Mar 14, 2017 #1 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 : Code: Copy #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: Mar 14, 2017
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 : Code: Copy #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
Erel B4X founder Staff member Licensed User Longtime User Mar 14, 2017 #2 No. Don't use the starter service for this. Use a different service. The starter service should never be the service that was designated to start. Upvote 0
No. Don't use the starter service for this. Use a different service. The starter service should never be the service that was designated to start.