0

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?

cptham
  • 23
  • 1
  • 4

1 Answers1

1

In these situations, I have always used the Application class 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 Activity class in order to easily grab a reference into your new Activity.

Community
  • 1
  • 1
Wroclai
  • 26,835
  • 7
  • 76
  • 67