Android Question App won't StartAtBoot

Startup

Active Member
Licensed User
Longtime User
I have a simple App to test StartAtBoot. It has a service module with the StartAtBoot attribute set to True and StartService(Starter) in its Sub Service_Start. It has the Starter Module with no additions/changes to the standard framework and a Main module with Activity.LoadLayout("Main") in Sub Activity_Create. Why doesn't this start when the device is turned on? Note: I've attached a zip of the file.
 

Attachments

  • TestStart.zip
    9.3 KB · Views: 214

Semen Matusovskiy

Well-Known Member
Licensed User
StartService(Starter) is not needed and is ignored.

For me the sample works like expected.
If you will add #BridgeLogger : True in Activity and will reboot a smartphone, you will see in Log
B4X:
** Receiver (startup) OnReceive **
*** Service (starter) Create ***
** Service (starter) Start **
** Service (startup) Create **
** Service (startup) Start **
** Service (starter) Start **

What did you expect ? If you want to see main form after reboot, you must add StartActivity (Main) inside the service.
 
Upvote 0

Startup

Active Member
Licensed User
Longtime User

Yes I did want to see main form after reboot and by adding StartActivity(''Main") in Starter I now see it. (I thought I had read that the Starter goes to the Main after running so didn't need to put StartActivity("Main") in the Starter. Also removed unnecessary StartService(Starter as you suggested. Works fine now. Thanks!
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…