java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.dennis.afbstellplatzbuchung/com.example.dennis.afbstellplatzbuchung.Settings}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference

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

    App crashes when swittching Activity

    Stack Overflow | 5 months ago | Dennis Bölling
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.dennis.afbstellplatzbuchung/com.example.dennis.afbstellplatzbuchung.Settings}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference

    Root Cause Analysis

    1. java.lang.NullPointerException

      Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference

      at com.example.dennis.afbstellplatzbuchung.Settings.backToMain()
    2. com.example.dennis
      Settings.onCreate
      1. com.example.dennis.afbstellplatzbuchung.Settings.backToMain(Settings.java:134)
      2. com.example.dennis.afbstellplatzbuchung.Settings.onCreate(Settings.java:41)
      2 frames
    3. Android Platform
      ActivityThread.performLaunchActivity
      1. android.app.Activity.performCreate(Activity.java:6876)
      2. android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135)
      3. android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3207)
      3 frames