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:
    java.lang.RuntimeException: Unable to start service with null: java.lang.RuntimeException: java.lang.RuntimeException: Object should first be initialized (Intent).
    Someone had the same issue ( 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:
    If StartingIntent.Action = "android.bluetooth.device.action.FOUND" Then
    end if
    Is the problem related to this?

    Thank You!
  2. Erel

    Erel Administrator Staff Member Licensed User

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