简体   繁体   中英

geo:latitude,longitude?z=zoom in android taking me to my current location

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?

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 ie 76.6464831 35.494 something..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM