title: Remove fragment from backstack in nested fragments android
body: <p>I have a MainActivity in which I have Added a Fragment ==> BenefitsFragment
  in BenefintsFragment there is a RelativeLayout</p>
  
  <pre><code>&lt;RelativeLayout
          android:visibility="gone"
          android:background="@android:color/white"
          android:id="@+id/benefitContainer"
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
  
  
      &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>I am adding another fragment like </p>
  
  <pre><code>   browseBtn.setOnClickListener(new View.OnClickListener()
              {
                  @Override
                  public void onClick(View v)
                  {
                      RelativeLayout mLayout = (RelativeLayout) view.findViewById(R.id.benefitContainer);
                      mLayout.setVisibility(View.VISIBLE);
                      getChildFragmentManager().beginTransaction()
                              .add(R.id.benefitContainer, new ConfirmPinFragment()).commitNow();
                  }
              });
  </code></pre>
  
  <p>In my new <code>ConfirmPinFragment</code> I am trying to go back to old <code>BenefitsFragment</code> as </p>
  
  <pre><code>    backBtn.setOnClickListener(new View.OnClickListener()
              {
                  @Override
                  public void onClick(View v)
                  {
                      getChildFragmentManager().popBackStack();
                  }
              });
  </code></pre>
  
  <p>However this <code>popBackStack</code> not working, if i try to remove using </p>
  
  <pre><code>        getChildFragmentManager().beginTransaction().remove(ConfirmPinFragment.this).commitNow();
  </code></pre>
  
  <p>It crashes saying </p>
  
  <pre><code>java.lang.IllegalStateException: FragmentManager is already executing transactions
  </code></pre>