1

I want to call the inbuilt map app from my app. I came across this link. this page also gave me this link where I could really get what I want. I know

geo:latitude,longitude?z=zoom

is still in development mode.

My problem is that when ever I use this it takes to the desired location but then diverts me to my current location.

Here is the piece code I am using it

String uri = String.format("geo:%f,%f?z=18",(float)(latitude /1E6),(float)(longitude/1E6));
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
startActivity(intent);

How can I fix it?

Community
  • 1
  • 1
Nik
  • 2,913
  • 7
  • 40
  • 66

1 Answers1

1

You can try this one.....

Intent mapintent = new Intent(android.content.Intent.ACTION_VIEW,Uri.parse("geo:0,0?q="+lat_string+long_string+"(Title_to_show)"));

Where lat_string and long_string are in there original format i.e 76.6464831 35.494 something..

alex
  • 10,900
  • 15
  • 70
  • 100
Parvaz Bhaskar
  • 1,367
  • 9
  • 29