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 | 6 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Android/Java CheckBox returns null, even when initialised

    Stack Overflow | 6 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