title: Receive result from DialogFragment
body: <p>I am using <strong>DialogFragments</strong> for a number of things: choosing item from list, entering text. </p>
  
  <p>What is the best way to return a value (i.e. a string or an item from a list) back to the calling activity/fragment? </p>
  
  <p>Currently I am making the calling activity implement <code>DismissListener</code> and giving the DialogFragment a reference to the activity. The Dialog then calls the <code>OnDimiss</code> method in the activity and the activity grabs the result from the DialogFragment object. Very messy and it doesn't work on configuration change (orientation change) as the DialogFragment loses the reference to the activity. </p>
  
  <p>Thanks for any help.</p>