java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.RelativeLayout.setVisibility(int)' on a null object reference

Stack Overflow | adler jawad | 5 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 - How can I access a RelativeLayout instantiated in onCreateView() from an other method in a Fragment

    Stack Overflow | 5 months ago | adler jawad
    java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.RelativeLayout.setVisibility(int)' on a null object reference

    Root Cause Analysis

    1. java.lang.NullPointerException

      Attempt to invoke virtual method 'void android.widget.RelativeLayout.setVisibility(int)' on a null object reference

      at Fragments.VerbFragment.backButtonWasPressed()
    2. Fragments
      VerbFragment.backButtonWasPressed
      1. Fragments.VerbFragment.backButtonWasPressed(VerbFragment.java:258)
      1 frame
    3. Activitys
      MainActivity2.onBackPressed
      1. Activitys.MainActivity2.onBackPressed(MainActivity2.java:136)
      1 frame