title: How can I display a Dialog from a PreferenceFragment?
body: <p>I'm trying to bring up a DialogFragment when I tap a Preference in a PreferenceFragment. Unfortunately, when I call <strong>getFragmentManager()</strong> in DialogFragment.show() I receive the following error:</p>
  
  <blockquote>
    <p>Cannot resolve method 'show(android.app.FragmentManager, java.lang.String)'</p>
  </blockquote>
  
  <p>The problem is that I can't seem to refernece <strong>android.support.v4.app.FragmentManager</strong> from this fragment. The activity in charge of this fragment extends from FragmentActivity, but obviously that's not enough. I tried calling <strong>getSupportFragmentManager()</strong> as well, but that gave me this error:</p>
  
  <blockquote>
    <p>Cannot resolve method 'getSupportFragmentManager()'</p>
  </blockquote>
  
  <p>How can I make this work?</p>
  
  <p>Here's some code:</p>
  
  <pre><code>gPrefAcknowledgements.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener()
  {
      @Override
      public boolean onPreferenceClick(Preference preference)
      {
          DialogAcknowledgements dialogAck = new DialogAcknowledgements();
          dialogAck.show(getFragmentManager(), "acknowledgements");
          return true;
      }
  });
  </code></pre>