title: How to store sparsearray in bundle
body: <p>I have a <code>SparseArray&lt;myObject&gt;</code> and want to store it in bundle in <code>onSaveInstanceState</code> method in my activity and restore it in <code>oncreate</code>. I found <code>putSparseParcelableArray</code> method for put SparseArray in bundle and did this in <code>onSaveInstanceState</code> method:</p>
  
  <pre><code>bundle.putSparseParcelableArray("mySparseArray", mySparseArray);
  </code></pre>
  
  <p>But eclips shows this error:</p>
  
  <pre><code>The method putSparseParcelableArray(String, SparseArray&lt;? extends Parcelable&gt;) in the type Bundle is not applicable for the arguments (String, SparseArray&lt;myObject&gt;)
  </code></pre>
  
  <p>And the quick fix is casting argument <code>mySparsArray</code> to <code>SparseArray&lt;? extends Parcelable&gt;</code>, but if I do so and get it in onCreate method:</p>
  
  <pre><code>mySparseArray = (SparseArray&lt;myObject&gt;) savedInstanceState.getSparseParcelableArray("mySparseArray");
  </code></pre>
  
  <p>It gets this error:</p>
  
  <pre><code>Cannot cast from SparseArray&lt;Parcelable&gt; to SparseArray&lt;myObject&gt;
  </code></pre>
  
  <p>If this way is wrong, what is the solution for put mySparseArray in bundle?
  Any help would be much appreciated. </p>