I am writing an application that opens up google maps and allows user to locate a place and retrieve its latitude and longitude back to application...please help me with the code...strong text
Asked
Active
Viewed 27 times
1 Answers
0
If you want to send latlng via intent then you have to :
latlng x;
String lat=string.valueof(x.getlatitude());
String lon=string.valueof(x.getlongitude())
Intent intent=new Intent();
Intent.putExtra("key-lat",lat);
Intent.putExtra("key-lon",lon);
And then in your second activity:
string lat=getintent.getStringExtra("key-lat");
string lon=getintent.getStringExtra("key-lon");
Latlng x=new latlng(lat.parseDouble(lat),lon.parseDouble(lon));
Tell me if this is what you are looking after.

Afshin Samiei
- 99
- 5