C coder22 Member Licensed User Longtime User May 4, 2013 #1 Is it possible to somehow make StartAtBoot in my service switchable between true/false? If the user had selected to have the service off and startatboot = true, then it runs on system reboot. Thanks!
Is it possible to somehow make StartAtBoot in my service switchable between true/false? If the user had selected to have the service off and startatboot = true, then it runs on system reboot. Thanks!
Erel B4X founder Staff member Licensed User Longtime User May 4, 2013 #2 It is technically not possible. When you set StartAtBoot the compiler adds an intent filter to the manifest file. What you can do is save the setting in a file and then when the service starts just call StopService if it isn't needed. Upvote 0
It is technically not possible. When you set StartAtBoot the compiler adds an intent filter to the manifest file. What you can do is save the setting in a file and then when the service starts just call StopService if it isn't needed.
MotoMusher Active Member Licensed User Longtime User May 4, 2013 #4 Another option is to have a "shell" service one layer higher. Always start that at boot. Read your variable in the shell service. If it is start at boot, start the other "real" service. If not, just stop the shell service. Upvote 0
Another option is to have a "shell" service one layer higher. Always start that at boot. Read your variable in the shell service. If it is start at boot, start the other "real" service. If not, just stop the shell service.
C coder22 Member Licensed User Longtime User May 4, 2013 #5 Good idea MotoM. thanks for that! Erel's method is working great for me now. Upvote 0