Nobody here able to comment on this issue? Is there a better way to pass my data to the activity?
On 11 Jan., 16:41, Moritz Post <[email protected]> wrote: > Hi there > > I am trying to invoke another Activity within my own application via > an Intent and a contained bundle. In the calling activity i use the > following code > > Bundle bundle = new Bundle(); > bundle.putParcelableArrayList(FeedImage.EXTRA_IMAGE_ENTRIES, > imageEntryArrayList); > > Intent intent = new Intent(FeedGallery.this, FeedImage.class); > intent.putExtras(bundle); > intent.setExtrasClassLoader(getClassLoader()); > startActivity(intent); > > The intent correctly invokes the targeted Activity (FeedImage) but the > unmarshalling fails in the following code: > > Intent intent = getIntent(); > Bundle bundle = intent.getExtras(); > this.imageList = bundle.getParcelableArrayList(EXTRA_IMAGE_ENTRIES); > > The error message is: android.os.BadParcelableException: > ClassNotFoundException when unmarshalling: > org.coolvisor.mrss.MediaRSSItem > > It has to be noted here that i explicitly set the classloader for the > unmarshelling in the intent creation via setExtrasClassLoader > (getClassLoader()); which takes the current classloder. > > Does anybody know why the unmarshalling fails although i have set the > correct classloader (i think)? > > The entire stacktrace of the exception: > > 01-11 15:37:20.648: ERROR/AndroidRuntime(1222): Uncaught handler: > thread main exiting due to uncaught exception > 01-11 15:37:20.849: ERROR/AndroidRuntime(1222): > java.lang.RuntimeException: Unable to start activity ComponentInfo > {org.coolvisor/org.coolvisor.FeedImage}: > android.os.BadParcelableException: ClassNotFoundException when > unmarshalling: org.coolvisor.mrss.MediaRSSItem > 01-11 15:37:20.849: ERROR/AndroidRuntime(1222): at > android.app.ActivityThread.performLaunchActivity(ActivityThread.java: > 2140) > 01-11 15:37:20.849: ERROR/AndroidRuntime(1222): at > android.app.ActivityThread.handleLaunchActivity(ActivityThread.java: > 2156) > 01-11 15:37:20.849: ERROR/AndroidRuntime(1222): at > android.app.ActivityThread.access$1800(ActivityThread.java:112) > 01-11 15:37:20.849: ERROR/AndroidRuntime(1222): at > android.app.ActivityThread$H.handleMessage(ActivityThread.java:1580) > 01-11 15:37:20.849: ERROR/AndroidRuntime(1222): at > android.os.Handler.dispatchMessage(Handler.java:88) > 01-11 15:37:20.849: ERROR/AndroidRuntime(1222): at > android.os.Looper.loop(Looper.java:123) > 01-11 15:37:20.849: ERROR/AndroidRuntime(1222): at > android.app.ActivityThread.main(ActivityThread.java:3742) > 01-11 15:37:20.849: ERROR/AndroidRuntime(1222): at > java.lang.reflect.Method.invokeNative(Native Method) > 01-11 15:37:20.849: ERROR/AndroidRuntime(1222): at > java.lang.reflect.Method.invoke(Method.java:515) > 01-11 15:37:20.849: ERROR/AndroidRuntime(1222): at > com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run > (ZygoteInit.java:739) > 01-11 15:37:20.849: ERROR/AndroidRuntime(1222): at > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497) > 01-11 15:37:20.849: ERROR/AndroidRuntime(1222): at > dalvik.system.NativeStart.main(Native Method) > 01-11 15:37:20.849: ERROR/AndroidRuntime(1222): Caused by: > android.os.BadParcelableException: ClassNotFoundException when > unmarshalling: org.coolvisor.mrss.MediaRSSItem > 01-11 15:37:20.849: ERROR/AndroidRuntime(1222): at > android.os.Parcel.readParcelable(Parcel.java:1880) > 01-11 15:37:20.849: ERROR/AndroidRuntime(1222): at > org.coolvisor.ImageEntry.<init>(ImageEntry.java:40) > 01-11 15:37:20.849: ERROR/AndroidRuntime(1222): at > org.coolvisor.ImageEntry$1.createFromParcel(ImageEntry.java:17) > 01-11 15:37:20.849: ERROR/AndroidRuntime(1222): at > org.coolvisor.ImageEntry$1.createFromParcel(ImageEntry.java:1) > 01-11 15:37:20.849: ERROR/AndroidRuntime(1222): at > android.os.Parcel.readParcelable(Parcel.java:1903) > 01-11 15:37:20.849: ERROR/AndroidRuntime(1222): at > android.os.Parcel.readValue(Parcel.java:1771) > 01-11 15:37:20.849: ERROR/AndroidRuntime(1222): at > android.os.Parcel.readListInternal(Parcel.java:2014) > 01-11 15:37:20.849: ERROR/AndroidRuntime(1222): at > android.os.Parcel.readArrayList(Parcel.java:1461) > 01-11 15:37:20.849: ERROR/AndroidRuntime(1222): at > android.os.Parcel.readValue(Parcel.java:1792) > 01-11 15:37:20.849: ERROR/AndroidRuntime(1222): at > android.os.Parcel.readMapInternal(Parcel.java:2005) > 01-11 15:37:20.849: ERROR/AndroidRuntime(1222): at > android.os.Parcel.readBundleUnpacked(Parcel.java:1405) > 01-11 15:37:20.849: ERROR/AndroidRuntime(1222): at > android.os.Bundle.unparcel(Bundle.java:159) > 01-11 15:37:20.849: ERROR/AndroidRuntime(1222): at > android.os.Bundle.getParcelableArrayList(Bundle.java:1076) > 01-11 15:37:20.849: ERROR/AndroidRuntime(1222): at > org.coolvisor.FeedImage.onCreate(FeedImage.java:45) > 01-11 15:37:20.849: ERROR/AndroidRuntime(1222): at > android.app.Instrumentation.callActivityOnCreate(Instrumentation.java: > 1122) > 01-11 15:37:20.849: ERROR/AndroidRuntime(1222): at > android.app.ActivityThread.performLaunchActivity(ActivityThread.java: > 2103) > 01-11 15:37:20.849: ERROR/AndroidRuntime(1222): ... 11 more --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

