title: Passing an Object to Fragment or DialogFragment upon Instantiation
body: <p>I'm trying to work out the correct way to pass in an Object to a <a href="http://developer.android.com/reference/android/support/v4/app/Fragment.html" rel="noreferrer">Fragment</a> or <a href="http://developer.android.com/reference/android/support/v4/app/DialogFragment.html" rel="noreferrer">DialogFragment</a> without breaking the '<a href="http://developer.android.com/reference/android/support/v4/app/Fragment.html#Fragment%28%29" rel="noreferrer">empty constructor</a>' rule.</p>
  
  <p>For example I have created a custom View and for each one I instantiate I want to associate a DiaglogFragment. This DialogFragment will be used to display controls with which the user can alter certain aspects of the custom View it is associated with. Because View is an Object I understand I cannot use <a href="http://developer.android.com/reference/android/support/v4/app/Fragment.html#setArguments%28android.os.Bundle%29" rel="noreferrer">setArguments()</a>. </p>
  
  <p>I could implement a newInstance(View) method of my DialogFragment i.e. Factory pattern but then what happens if my Fragment is saved by the system and then restored at a later date? As far as I can tell there will be no reference to the View object?</p>
  
  <p>Could someone tell me if I am using Fragments in the wrong way or is there way to achieve passing in an object to the Fragment which will also cope with the system reconstructing it at a later time.</p>