简体   繁体   中英

Redirect user to Google Maps Android application to show a direction

I am working in an android application and I have two Geo points. I want the user to redirect to the google map android application from my application to show the directions in the map. How can I pass the two geopoints to google map android application to show the direction in the google map application.

Here's an example showing directions in the Google Maps app using an intent.

From the linked answer:

Intent intent = new Intent(android.content.Intent.ACTION_VIEW, 
Uri.parse("http://maps.google.com/maps?saddr=20.344,34.34&daddr=20.5666,45.345"));
startActivity(intent);

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