java.lang.RuntimeException: Unable to stop activity {com.example.e103046.sitef_v2/com.example.e103046.sitef_v2.ViewSettings}: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.widget.CheckBox.isChecked()' on a null object reference

Stack Overflow | Packfacker | 7 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Android/Java CheckBox returns null, even when initialised

    Stack Overflow | 7 months ago | Packfacker
    java.lang.RuntimeException: Unable to stop activity {com.example.e103046.sitef_v2/com.example.e103046.sitef_v2.ViewSettings}: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.widget.CheckBox.isChecked()' on a null object reference

    Root Cause Analysis

    1. java.lang.NullPointerException

      Attempt to invoke virtual method 'boolean android.widget.CheckBox.isChecked()' on a null object reference

      at com.example.e103046.sitef_v2.ViewSettings.initCheckBox()
    2. com.example.e103046
      ViewSettings.onStop
      1. com.example.e103046.sitef_v2.ViewSettings.initCheckBox(ViewSettings.java:83)
      2. com.example.e103046.sitef_v2.ViewSettings.onStop(ViewSettings.java:123)
      2 frames
    3. Android Platform
      ActivityThread.performDestroyActivity
      1. android.app.Instrumentation.callActivityOnStop(Instrumentation.java:1275)
      2. android.app.Activity.performStop(Activity.java:6492)
      3. android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4145)
      3 frames