title: Saving Hashmap of arraylist in Android
body: <p>I am trying to save hashmap of arraylist. I am using custom class MailMessage which is itself parcelable. How can I save the Hashmaps? I am saving/restoring map as:</p>
  
  <pre><code>&lt;code&gt;
  HashMap&lt;String, ArrayList&lt;MailMessage&gt;&gt; emailsMap = new HashMap&lt;String, ArrayList&lt;MailMessage&gt;&gt;();
  
  @Override
      protected void onSaveInstanceState(Bundle outState) {
          outState.putSerializable("emailsMap", emailsMap);
          super.onSaveInstanceState(outState);
      }
  
      @Override
      protected void onRestoreInstanceState(Bundle state) {
          // TODO Auto-generated method stub
          super.onRestoreInstanceState(state);
          emailsMap = (HashMap&lt;String, ArrayList&lt;MailMessage&gt;&gt;) state.getSerializable("emailsMap");
      }
  &lt;/code&gt;
  </code></pre>
  
  <p>But in restore instance state, i am getting empty map. What can be the issue? I am saving restoring in right way?</p>