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

Discussion in 'Android Questions' started by Albi, Feb 23, 2015.

  1. Albi

    Albi Active Member Licensed 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.
     
  2. cds-soft

    cds-soft Member Licensed 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.
    Code:
    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: http://www.b4x.com/android/forum/th...-service-long-running-background-tasks.27065/

    Sorry for my English
     
  3. Albi

    Albi Active Member Licensed 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.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice