Bit of a weird question.
I’m passing data from one activity to another – specifically two GeoPoints. But, as I discovered, you can’t pass an ArrayList of type GeoPoint. I thought of converting them to strings and passing them through in an ArrayList of type string (so, geopoint1.tostring()), which went fine, but I have no idea how to then convert them back to a GeoPoint in the next activity.
What I’m doing might be totally mental and stupid, but I just can’t seem to think of any other way.
I’ve posted this quick question to try and get some quick responses, but if you need any more info just ask me, I’ll put it straight up.
BTW, I’m passing the data using intent.putExtra, etc.
Thanks guys!
The
getLatitudeE6()/getLongitudeE6()of GeoPoint returns an int.So you can use your coordinate in an array of int and send it with
putExtra(String name, int[] value)from the intentand retrieve the array from the target activity with
getIntent().getExtras().getIntArrayOr you can put the latitude/longitude with different key in the Intent’s Extra with
putExtra(String name, int value)