Android Question App works except on start at boot (used to work?)

almontgreen

Active Member
Licensed User
Longtime User
After installing B4A latest version when I am testing and running everything works fine. When I plug in unit to test start at boot, the app launches into a black screen and hangs. This used to work fine and launch at boot as predicted.

Should I try to roll back to an earlier version of B4A that worked? The logs and everything works fine when the app is launched from the Bridge install debug version. Then compile to release do the bridge then unplug and it starts up and hangs with nothing working.

I could send code, but the code works fine when run from the device by double clicking the icon. It only hangs when started at boot.

This is what I have in the starter service:

B4X:
#Region  Service Attributes
    #StartAtBoot: True
#End Region

Sub Process_Globals
'    Nothing here...
End Sub
Sub Service_Create

End Sub

Sub Service_Start (StartingIntent As Intent)
    StartActivity(Main)
End Sub

Sub Service_Destroy

End Sub
 

almontgreen

Active Member
Licensed User
Longtime User
Problem resolved, finally found example in the forum and changed code to this and it works now:
B4X:
#Region  Service Attributes
    #StartAtBoot: True
#End Region

Sub Process_Globals

End Sub
Sub Service_Create
   
    Dim i As Intent
    i.Initialize("", "")
    i.SetComponent("mypackagenameishere/.main") '<-- Replace this with the name of your package
   
    StartActivity(i)
   
    StopService("")

End Sub

Sub Service_Start (StartingIntent As Intent)
    'StartActivity(Main) <- this was commented out
End Sub

Sub Service_Destroy

End Sub
 
Upvote 0
Top