java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setBackgroundColor(int)' on a null object reference

Stack Overflow | Johny | 6 months ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    ListView.getChildAt().setBacgroundColor() crash

    Stack Overflow | 6 months ago | Johny
    java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setBackgroundColor(int)' on a null object reference

    Root Cause Analysis

    1. java.lang.NullPointerException

      Attempt to invoke virtual method 'void android.view.View.setBackgroundColor(int)' on a null object reference

      at com.samo.facedatefb.SendMessage$2.onDataChange()
    2. com.samo.facedatefb
      SendMessage$2.onDataChange
      1. com.samo.facedatefb.SendMessage$2.onDataChange(SendMessage.java:265)
      1 frame
    3. com.google.android
      zzajh$1.run
      1. com.google.android.gms.internal.zzaie.zza(Unknown Source)
      2. com.google.android.gms.internal.zzaje.zzcta(Unknown Source)
      3. com.google.android.gms.internal.zzajh$1.run(Unknown Source)
      3 frames
    4. Android Platform
      ActivityThread.main
      1. android.os.Handler.handleCallback(Handler.java:815)
      2. android.os.Handler.dispatchMessage(Handler.java:104)
      3. android.os.Looper.loop(Looper.java:194)
      4. android.app.ActivityThread.main(ActivityThread.java:5549)
      4 frames
    5. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invoke(Native Method)
      2. java.lang.reflect.Method.invoke(Method.java:372)
      2 frames
    6. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:964)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:759)
      2 frames