title: Dismiss Dialog Fragment when pressed outside
body: <p>I use Dialog Fragment I extend it</p>
  
  <pre><code>public class DocumentLibrarySelectionFragment extends DialogFragment 
  </code></pre>
  
  <p>I am not sure how to dismiss this dialog when the user presses outside it (I show this dialog inside my activity). I went through other related questions, but couldn't find complete answer, for example this <a href="https://stackoverflow.com/questions/8404140/how-to-dismiss-a-dialogfragment-when-pressing-outside-the-dialog">How to dismiss a DialogFragment when pressing outside the dialog?</a> here, where to add this lines of code in the first answer? Thanks.</p>