title: DialogFragment advantages over AlertDialog
body: <p>When developing an Android app, I've read that it's recommended to use <code>DialogFragment</code> instead of using directly an <code>AlertDialog</code> to show alerts and confirmations.</p>
  
  <p>This is done, for example, on DialogFragment's Documentation: <a href="http://developer.android.com/reference/android/app/DialogFragment.html" rel="noreferrer">http://developer.android.com/reference/android/app/DialogFragment.html</a></p>
  
  <p>People also say they prefer this here:
  <a href="https://stackoverflow.com/questions/7977392/android-dialogfragment-vs-dialog">Android DialogFragment vs Dialog</a></p>
  
  <p>I would like to know the advantages of this approach, since the code becomes more complex.</p>
  
  <p>Thanks</p>