That sounds good, but how do you do that? I am totally a beginner, I
am thinking of something like:
public class MyParcelable implements Parcelable {
private Object SpecialObject = someObject;
public void writeToParcel(Parcel out, int flags) {
binder = ???????????
out.writeStrongBinder(binder);
}
private MyParcelable(Parcel in) {
binder = in.readStrongBinder();
SpecialObject = binder.????????????
}
public static final Parcelable.Creator CREATOR = new
Parcelable.Creator() {
public MyParcelable createFromParcel(Parcel in) { return new
MyParcelable(in); }
public MyParcelable[] newArray(int size) { return new
MyParcelable[size];}
}
}
On Apr 17, 5:19 pm, mmcev106 <[email protected]> wrote:
> I finally found a way to do this. I'm surprised that there hasn't
> been more discussion about it.
>
> To pass an arbitrary object reference using an Intent, you must create
> a Binder that has a reference to your object. Then you must create a
> Parcelable that adds an instance of the Binder to Parcel. See the
> section titled "Active Objects" of the documenation for the Parcel
> class. You can then put and get your Parcelable from an Intent.
>
> On Feb 20, 12:15 pm, mmcev106 <[email protected]> wrote:
>
> > I know you can pass Serializable classes via Intents using putExtra()
> > or Bundles, but how do you pass references to classes that don't
> > implement Serializable? It it possible? If not, why would this not
> > be supported?
>
> > Thank you,
> > Mark
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---