You don't need to pass it using intents, just use a static class with
static public variables, and you can make one of those variables a
type of the object you are trying to pass. Then just assign that
variable to your instance. Now any activity can get to it by using the
global accessor (so if you have a static class named "myclass", and
the variable is "myobject var1", you can get to it from anywhere using
myclass.var1 cause it's all static and therefore global in scope)
This would be much easier, cleaner, and faster.
-niko
On Oct 18, 8:49 am, "loril...@gmail.com" <loril...@gmail.com> wrote:
> I am trying to pass a user defined object to another activity
>
> Bundle bundle = new Bundle();
> bund.putSerializable("myData", myData);
> intent.putExtra("bundle", bundle);
>
> where myData class implements Serializable interface.
>
> I am getting following error:
>
> java.lang.RuntimeException: Parcelable encountered IOException writing
> serializable object
>
> Could anyone please let me know how to pass complex objects between
> activities?
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment