I am trying to pass an array of type Coordinates (coordinate[] arrCoordinates) to another Activity class. I find it easy to pass Strings and Ints (e.g intent.putExtra(“string”, myString); but I can’t seem to pass an array of coordinates.
I also tried looking into using Parcelable..but I’m not quite sure on coding it. Could anyone help me out?
I am trying to pass an array of type Coordinates (coordinate[] arrCoordinates) to another
Share
In these situations, I have always used the
Applicationclass to store global variables.See this answer for more information.
A dirty hack (which I do not recommend) is to make your array a public static member of your first
Activityclass in order to easily grab a reference into your newActivity.