-2

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

Sri Ram
  • 3
  • 1

1 Answers1

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.