First, differentiate the two cases by two different request codes.

Second, use a package qualified extra name for your own activity, e.g. "com.bartatamas.superapp.SETTINGS". Shouldn't be necessary with item one, but won't hurt either.

-- Kostya

25.03.2011 17:03, b_t пишет:
Hi,

My activity starts other activities to get a result from them:
- starts an activity of mine which returns a Serializable object with
the intent
or
- starts an activity with ACTION_PICK to pick a contact

In my onActivityResult method I check if it is the first case or not
by calling

     Settings settings =
(Settings)data.getSerializableExtra("SETTINGS");

I got the following exceptions:

Caused by: android.os.BadParcelableException: ClassNotFoundException
when unmarshalling: com.motorola.blur.provider.contacts.IdentityModel
        at android.os.Parcel.readParcelable(Parcel.java:1883)
        at android.os.Parcel.readParcelableArray(Parcel.java:1922)
        at android.os.Parcel.readValue(Parcel.java:1825)
        at android.os.Parcel.readMapInternal(Parcel.java:2008)
        at android.os.Bundle.unparcel(Bundle.java:208)
        at android.os.Bundle.getSerializable(Bundle.java:1189)
        at android.content.Intent.getSerializableExtra(Intent.java:
3469)
        ...

I don't understand it. What is this IdentityModel class? If my
activity returns than
the serializable object is a "Settings". If an other activity returns
than "SETTINGS"
extra should be null. Why I get ClassNotFoundException?

T.



--
Kostya Vasilyev -- http://kmansoft.wordpress.com

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