3

Possible Duplicate:
How to show marker in Maps launched by geo uri Intent?

I have an intent to a Google Maps application with one geolocation I got from my database, is it possible for GM to put a pushpin in the location I'm sending with the URI?

final String uri = "geo:" + location.Latitude + "," + location.Longitude + "?z=12";
MyActivity.this.startActivity(new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(uri)));
Community
  • 1
  • 1
MLProgrammer-CiM
  • 17,231
  • 5
  • 42
  • 75

1 Answers1

7

You need to specify a name for the pin:

String uri = "geo:0,0?q="+ Lat + "," + Longitude + " (" + name+ ")";
startActivity(new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(uri)));

This will work for one pin only.

Waza_Be
  • 39,407
  • 49
  • 186
  • 260
  • "geo:" + location.Latitude + "," + location.Longitude + "?z=12" + "&q=" + location.Latitude + "," + location.Longitude + "(Syncpoint)"; It needs the & to include both the query and the zoom. – MLProgrammer-CiM Jan 11 '13 at 09:56