I want to pass the values from MapOverlay class to another class. I tried to use an Intent
Intent i = new Intent(getApplicationContext(), AnotherClass.class);
i.putExtra("value1", x1);
i.putExtra("value2", y1);
startActivity(i);
but Eclipse alerts me “The method getApplicationContext() is undefined for the type MapOverlay” so I can’t use this method to pass the values. Please advise me on how I should do this.
Thanks in advance.
I suggest you to Use GetSet method for this –
In your Mapoverlay class –
Getset.java
And, whereever you need that values, just get like below code –
Here,
resultofoverlayis a string array. Try to declare this as global.