tags:

views:

101

answers:

1

Hi

I have created Intent and I put data using putExtramethod.

Now I want to put my geoPointsArraytype variable to my intent object, here is type of geoPointsArray :

List<GeoPoint> geoPointsArray = new ArrayList<GeoPoint>();

In existing methods putExtraI can't find how to put my custom type.

Can someone help me with this?

Thanks

A: 

GeoPoint must be Parcelable or Serializable. So you should subclass it to add these functionalities as I think they miss from the original implementation.

Then look into these other questions they will help you. http://stackoverflow.com/questions/3136922/serialization-issue-with-sortedset-arrays-an-serializable

Pentium10
thanks Pentium10, can you please give me code for this?
Jovan
Do you still need the code, as it is on the linked question. For parcelable just implement the `Parcelable`
Pentium10
@Pentium10 can you please give me code for implementing Parcelable for my type. THANKS!!
Jovan
Just define your GeoPoint class as this:`public class MyGeoPoint implements Serializable`
Pentium10
I send mapIntent.putExtra("parc", new MyGeoPoint()); using sendBroadcast(mapIntent); to reciver. In onReceive I get extra using:Serializable prp; prp =intent.getExtras().getSerializable("parc");. Can you please tell me how can I extract this information for use
Jovan
MyGeoPoint class : public class MyGeoPoint implements Serializable{ int a = 1000; }
Jovan