title: FragmentManager.beginTransaction() on null object reference when trying to add new dialogFragment to a exsisting dialogfragmen whicht is on a fragment
body: <p>this is not a duplicate question as the occurrence of the issue is different.. as i am only experiencing this behavior when i try to do exact what i have mentioned(layout order wise) </p>
  
  <p>i am trying to create a new dialog fragment trough another dialog fragment. when i try to do that it throws an <code>error</code></p>
  
  <pre><code>java.lang.NullPointerException: Attempt to invoke virtual method 'android.support.v4.app.FragmentTransaction android.support.v4.app.FragmentManager.beginTransaction()' on a null object reference
          at android.support.v4.app.DialogFragment.show(DialogFragment.java:142)
  </code></pre>
  
  <hr>
  
  <p>this is the related code </p>
  
  <pre><code>ForgotPasswordFailedFragment forgotPasswordFailedFragment = new ForgotPasswordFailedFragment();
          forgotPasswordFailedFragment.show(getFragmentManager(), "Password Reset Failed");
  </code></pre>
  
  <hr>
  
  <p>so my view order is something like this.. </p>
  
  <blockquote>
    <p>mainActivity -> fragment -> dialogfragment -> dialogfragment (i'am trying to get this)</p>
  </blockquote>
  
  <p>i have tried mentioned answers and tease are the  errors that occurred for each change...</p>
  
  <p>ForgotPswrdSuccessFragment forgotPswrdSuccessFragment = new ForgotPswrdSuccessFragment();
  forgotPswrdSuccessFragment.show(requireActivity().getSupportFragmentManager(), "Password Reset Failed");</p>
  
  <p>this throws     </p>
  
  <pre><code> Fragment ForgotPasswordDFragment{725811b} not attached to an activity.
              at android.support.v4.app.Fragment.requireActivity(Fragment.java:724)
              at *********.SignIn.ForgotPassword.ForgotPasswordDFragment.showSuccessDialog(ForgotPasswordDFragment.java:85)
  </code></pre>
  
  <p>ForgotPasswordDFragment is a dialog fragment which is on a fragment 
  and i am calling another dialogfragment from (ForgotPasswordDFragment)  there..and now that action is throwing above mentioned eror</p>
  
  <p>for this </p>
  
  <pre><code>forgotPswrdSuccessFragment.show(this.getChildFragmentManager(), "Password Reset Failed");
  </code></pre>
  
  <p>the exception is </p>
  
  <p>java.lang.IllegalStateException: Fragment has not been attached yet.
          at android.support.v4.app.Fragment.instantiateChildFragmentManager(Fragment.java:2383)</p>