title: Saving and Restoring Custom Object in fragment
body: <p>I have two fragments FragmentA and FragmentB. 
  From Fragment A i update Views in Fragment B by passing custom object as a parameter to a method in Fragment B.
  For example below is the Fragment B:</p>
  
  <pre><code>public class FragmentB extends Fragment {
  
  private ArrayList&lt;String&gt; customObj = new ArrayList&lt;String&gt;();
  
          public void updateViews(ArrayList&lt;String&gt; obj) {
                  customObj = obj;
  
           }
  
      @Override
          public void onSaveInstanceState(Bundle outState) {
          System.out.println("Custom Object : "+customObj);//custom object is always  empty
          }
  </code></pre>
  
  <p>Now, whenever i rotate the screen, the custom object is al;ways empty.</p>
  
  <p><strong>Note</strong>
  Here I am just updating the views of Fragement B. The object is passed as a parameter from Fragment A to the method updateViews of Fragment B.
  Also, i am not looking forward to define static for custom object.</p>