Please do *not* use Serializable. It is really inefficient. If you want to implement custom marshalling/unmarshalling, implement Parcelable. It requires that you do more work, but it is far more efficient.
On Sat, Sep 18, 2010 at 3:57 AM, YuviDroid <yuvidr...@gmail.com> wrote: > I haven't played with this, but if you make your class (myArrayType) implement > the Serializable interface it should work fine. Of course, all the instance > variables of that class must also be Serializable, otherwise you would still > get an exception (probably a NotSerializableException). > > Hope it helps, > Yuvi > > > On Sat, Sep 18, 2010 at 12:46 PM, jlopeznava...@gmail.com < > jlopeznava...@gmail.com> wrote: > >> I have 2 dimensions array like this: >> public myArrayType[][] mObjArray; >> >> I want to save it in the onSaveInstanceState method, since my array >> contains lot of elements I dont want to save element by element but >> the whole array object, what is the best way? >> >> I tried this but exception is thrown: >> >> --------------------------------------------------------- >> >> public Bundle saveState(Bundle map) { >> >> if (map != null) { >> map.putSerializable("objLevel", (Serializable) >> mCurrentLevelMatrix); >> } >> >> return map; >> } >> >> ------------------------------------------------------- >> >> I have seen a putParcelableArrayList method but dunno how it works >> exactly. >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Android Developers" group. >> To post to this group, send email to android-developers@googlegroups.com >> To unsubscribe from this group, send email to >> android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com> >> For more options, visit this group at >> http://groups.google.com/group/android-developers?hl=en > > > > > -- > YuviDroid > Check out Launch-X <http://android.yuvalsharon.net/launchx.php> (a widget > to quickly access your favorite apps and contacts!) > http://android.yuvalsharon.net > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com> > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en