Can service modules only start at boot on certain system versions?

mistermentality

Active Member
Licensed User
Longtime User
I have found that my service starts fine when the app starts, but although ticked to start at boot whenever I reboot the device every time I get the force close error for the app.

However it never force closes when started manually after a boot, and there are no task managers killing it so I was wondering does the start at boot feature only work on specific versions of Android as on my 2.2 phone it closes after reboot every single time.

There's no error message given and the code will work great if I restart it but I need the code to start itself on booting. Do I need to change my version of the operating system?

Dave
 

mistermentality

Active Member
Licensed User
Longtime User
How do I check the logs? I have never had to before and it only happens after a reboot so would there be a specific folder in android where the logs can be read from?

Thanks

Dave

Edit: I have tried rebooting while connected to the ide and running the app but the ide log stops when the phone restarts so cannot check any errors that way
 
Last edited:
Upvote 0

mistermentality

Active Member
Licensed User
Longtime User
The logs displayed are kept in an internal buffer by the OS. Connect to your device after the boot and look for a an error message followed by a stack trace.

I found the cause but I need advice on a solution. The error that located the issue was....

B4X:
Caused by: java.lang.NullPointerException

   at anywheresoftware.b4a.objects.NotificationWrapper.setIcon(NotificationWrapp

I took out the references to the notifications in the service module and all works great but I would like notification. My code for the notifications was:

B4X:
Sub Process_Globals
n.Initialize
n.Icon = "icon"
End Sub

n.SetInfo("KidSafe", "request received by text", Main)
n.Notify(1)

Which I understood would, as it did in testing, tell the notifier icon to be the apps icon. Without the notifier code the service works flawlessly after a reboot but did I make any noticeable mistake with the notifier code shown above that somehow induces the crash?

Thanks.

Dave
 
Upvote 0

Similar Threads

Top