简体   繁体   中英

Navigation Android and Google Maps

I am using google navigation in my app.

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("google.navigation:q=53.3,21.7"));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);

Is any way to open this navigation in my app with custom settings?

Try this:

float lat = 53.3f; float lng = 21.7f;

String maplLabel = "ABC Label";
final Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
        Uri.parse("geo:0,0?q="+lat+","+lng+"&z=16 (" + maplLabel + ")"));
startActivity(intent);

In this way, you open the external App maps.

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