Skip to content Skip to sidebar Skip to footer

How To Pass Object To Another Activity

I have a Placemark class that extends from Location class, so I think in this situation I can't use 'implements Serializable' here. If anyone know how to use Serializable here, ple

Solution 1:

1) Instead of

p.writeValue(pm);

and

pm = (Placemark) p.readValue(Placemark.class.getClassLoader());

try to write:

p.writeParcelable(pw, 0);

and

pm = (Placemark) p.readParcelable(Placemark.class.getClassLoader());

2) Is your class Placemark implements Parcelable interface?

Solution 2:

You can create a subclass of Application and store the object there. Here's an example.

Post a Comment for "How To Pass Object To Another Activity"