title: Replace Current fragment with another fragment from within the Current fragment
body: <p>I have an activity named as </p>
  
  <pre><code>MainActivity
  </code></pre>
  
  <p>i have added a fragment "<code>BenefitFragment</code>" in container <code>R.id.mainContainer</code>.</p>
  
  <p>In BenefitFragment layout i have another container <code>R.id.benefitContainer</code>. I am adding a nested fragment as</p>
  
  <pre><code>getChildFragmentManager().beginTransaction()
                          .add(R.id.benefitContainer, new ConfirmPinFragment())
                          .setCustomAnimations(R.anim.slide_in_left, R.anim.do_nothing)
                          .addToBackStack("benefit")
                          .commit();
  </code></pre>
  
  <p>In my <code>ConfirmPinFragment</code> after some processing i want to remove this ConfirmPinFragment and replace it with another Fragment let's say <code>TestFragment</code> and TestFragment can replace itself with another fragment and so on.</p>
  
  <p>Here is what i tried in <code>ConfirmPinFragment</code></p>
  
  <pre><code>CorporateFragment fragment = new CorporateFragment();
                      getFragmentManager().beginTransaction()
                                  .addToBackStack("benefit")
                                  .hide(ConfirmPinFragment.this)
                                  .add(android.R.id.content, fragment)
                                  .setCustomAnimations(R.anim.slide_in_left, R.anim.do_nothing)
                          .commit();
  </code></pre>
  
  <p>However i am getting error <code>android.R.id.content not found</code>. I want to replace the fragment from inside it and replace with another fragment, how will i do it.</p>