java.lang.NullPointerException: Attempt to invoke interface method 'void queendevelopers.com.communicate.MyFragmentInterface.setResult(java.lang.String)' 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

    Fragment communicating between fragment using interface failed, nullpointerException

    Stack Overflow | 6 months ago | Queendevelopers
    java.lang.NullPointerException: Attempt to invoke interface method 'void queendevelopers.com.communicate.MyFragmentInterface.setResult(java.lang.String)' on a null object reference

    Root Cause Analysis

    1. java.lang.NullPointerException

      Attempt to invoke interface method 'void queendevelopers.com.communicate.MyFragmentInterface.setResult(java.lang.String)' on a null object reference

      at queendevelopers.com.communicate.FragmentA$1.onClick()
    2. queendevelopers.com.communicate
      FragmentA$1.onClick
      1. queendevelopers.com.communicate.FragmentA$1.onClick(FragmentA.java:34)
      1 frame
    3. Android Platform
      ActivityThread.main
      1. android.view.View.performClick(View.java:4832)
      2. android.view.View$PerformClick.run(View.java:19844)
      3. android.os.Handler.handleCallback(Handler.java:739)
      4. android.os.Handler.dispatchMessage(Handler.java:95)
      5. android.os.Looper.loop(Looper.java:135)
      6. android.app.ActivityThread.main(ActivityThread.java:5319)
      6 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:1016)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:811)
      2 frames