title: getSupportFragmentManager failing in compatibility library
body: <p>I am displaying a dialog fragment in activity, tried using show() and add() methods. The code is given below</p>
  
  <pre><code>HelpDialogFragment hdf = HelpDialogFragment.newInstance();
  FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
  ft.add(hdf, "dialog");
  ft.commit(); #crash here
  </code></pre>
  
  <p>I get IllegalStateException error sometimes from the above code, The crash log is given below</p>
  
  <pre><code>java.lang.IllegalStateException: Activity has been destroyed
  at android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1329)
  at android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java:548)
  at android.support.v4.app.BackStackRecord.commit(BackStackRecord.java:532)
  at com.delight.activities.HomeActivity.showHelp(HomeActivity.java:311)
  </code></pre>
  
  <p>Line no. 311 in HomeActivity.java is <code>ft.commit()</code> mentioned in the code above. My activity extends FragmentActivity from compatibility library(which is update to date). The same crash occurs if i use <code>show()</code> method.</p>
  
  <pre><code>HelpDialogFragment hdf = HelpDialogFragment.newInstance();
  hdf.show(getSupportFragmentManager(), "dialog");  #same crash here
  </code></pre>
  
  <p>So i came to a conclusion that <code>getSupportFragmentManager()</code> is causing me the problems, what i don't understand is that , in what part of the code am I using the activity that has been destroyed, as far as i understand <code>getSupportFragmentManager()</code> should return me the manager for the activity that is present.</p>
  
  <p>I need some help in resolving this issue.</p>