Android Question Error starting intent: (Intent) Intent { act=android.intent.action.MAIN flg=0x30000000 cmp=b4a.motiv

Albi

Active Member
Licensed User
Longtime User
Hello,

I am have used the services to set an alarm. When I close the app with home/back button all is well. When I kill the process entirely, or restart the phone then it obviously destroys the alarm.

So I set StartAtBoot to True and removed all references to the main module from the service module. [There remains one, in the notifcation.setInfo("","Text here", Main)]

The error message that comes up is this:
Error starting intent: (Intent) Intent { act=android.intent.action.MAIN flg=0x30000000 cmp=b4a.example/.main }

The first time I try to compile the app, this error message appears. If I then retry to compile it, the app installs! Only, then when I restart the phone, it crashes.

If I build it in release mode, then it all seems to work ok!!

This thread has turned into less of a question, and probably won't even help anyone else who had this issue.

Sorry.
 

cds-soft

Member
Licensed User
Longtime User
I asume that you are using the bridge to install it in your device. Yes, i have the same error, but only when i unistall the aplicattion before reinstall it again on the device. In this case i have to do it twice. For me is a small problem with easy solution.

About the other problem, it's difficult to know. But if you want to make an alarm your process should be in foreground. Why crashes? Can't say with only this info.
B4X:
Sub Service_Create
    nNotify.Initialize
   nNotify.Icon = "icon"
   nNotify.SetInfo("Title", "Message", Main)
   nNotify.Sound=False
   nNotify.Vibrate=False
   nNotify.Light=False
   nNotify.OnGoingEvent=True
' make SO can't kill our service
   Service.StartForeground(1,nNotify)
End Sub

You can do it STIKY, but I read that they are kill after 5 second after the aplication is closed.
See this post: https://www.b4x.com/android/forum/t...-service-long-running-background-tasks.27065/

Sorry for my English
 
Upvote 0

Albi

Active Member
Licensed User
Longtime User
thanks, i'll have a look at the startforeground

at the moment, it's all working fine for me when i install in release mode.
 
Upvote 0
Top