java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.Dialog.setCanceledOnTouchOutside(boolean)' on a null object reference

Stack Overflow | W. Paul | 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

    Even after removing an erroneous line of code, an error still persists

    Stack Overflow | 6 months ago | W. Paul
    java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.Dialog.setCanceledOnTouchOutside(boolean)' on a null object reference

    Root Cause Analysis

    1. java.lang.NullPointerException

      Attempt to invoke virtual method 'void android.app.Dialog.setCanceledOnTouchOutside(boolean)' on a null object reference

      at com.gcapps.richcardsscorekeeper.ErrorDialog.onCreateDialog()
    2. com.gcapps.richcardsscorekeeper
      ErrorDialog.onCreateDialog
      1. com.gcapps.richcardsscorekeeper.ErrorDialog.onCreateDialog(ErrorDialog.java:94)
      1 frame
    3. Android Platform
      ActivityThread.main
      1. android.app.DialogFragment.getLayoutInflater(DialogFragment.java:398)
      2. android.app.FragmentManagerImpl.moveToState(FragmentManager.java:904)
      3. android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1082)
      4. android.app.BackStackRecord.run(BackStackRecord.java:833)
      5. android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1467)
      6. android.app.FragmentManagerImpl$1.run(FragmentManager.java:452)
      7. android.os.Handler.handleCallback(Handler.java:739)
      8. android.os.Handler.dispatchMessage(Handler.java:95)
      9. android.os.Looper.loop(Looper.java:145)
      10. android.app.ActivityThread.main(ActivityThread.java:6134)
      10 frames
    4. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invoke(Native Method)
      2. java.lang.reflect.Method.invoke(Method.java:372)
      2 frames
    5. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
      2 frames