Android Question App crash - Object should first be initialized (Intent)

Discussion in 'Android Questions' started by FrankBerra, May 21, 2015.

  1. FrankBerra

    FrankBerra Active Member Licensed User

    Hi all
    i have developed an app with a sticky service that is restarted at regular intervals. Everything seems to work but sometimes the app crashes randomly whithout reasons.

    I took a look to the Logcat and it says:
    Code:
    java.lang.RuntimeException: Unable to start service pippo.app.radar@2952976 with null: java.lang.RuntimeException: java.lang.RuntimeException: Object should first be initialized (Intent).
    Someone had the same issue (http://www.b4x.com/android/forum/threads/intent-not-initialize-in-process-restart.27528/) but i am not a skilled developer so i don't know how to solve this problem.

    Anyone can help me with an explanation about what it is going wrong?

    In the first lines of code of the service i put something like this:
    Code:
    If StartingIntent.Action = "android.bluetooth.device.action.FOUND" Then
    ...
    else
    ...
    end if
    Is the problem related to this?

    Thank You!
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Change your code to:
    Code:
    If StartingIntent.IsInitialized And StartingIntent.Action = ...
     
    FrankBerra likes this.
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