On Mon, Sep 26, 2011 at 1:12 PM, John Goche <johngoch...@googlemail.com>wrote:

> I don't see where the problem is with my code. I am hoping that someone
> here can shed some light on this issue.


Ah, I remember this issue. Short answer: Parcelable sucks. I'm fuzzy on the
details, but what I learned the hard way was this: if you use a custom
Parcelable, your process must be "around" for the system to find the class
loader to properly load that type. If your process is not "around", like
when you schedule an alarm for the future and your process has died,
attempting to load your custom class fails miserably as you see.

Google "parcelable ClassNotFoundException" for more information.

What I've done is create a "Bundleable" interface that basically does what
Parcelable is intended to do. Objects extending this interface can put
themselves and recreate themselves from a Bundle object, which is itself
Parcelable so you can send it around just like your object - except with the
minor fact that the system always knows how to load a Bundle type so you
don't run into this error.

-------------------------------------------------------------------------------------------------
TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
transit tracking app for Android-powered devices

-- 
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

Reply via email to