How to open map intent with directions?
I know about
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(String.format(Locale.US, "geo:%.8f,%.8f", latitude, longitude)));
startActivity(Intent.createChooser(intent, "Select an application"));
This code works fine for ONE point. But I want to show dialog with ALL map-applications, and open directions from point A to point B with any application (Google Map, Citymapper, web browser, etc).
On your computer, open Google Maps. Go to the directions, map, or Street View image you want to share. Select Share or embed map. If you don't see this option, click Link to this map.
have you tried this
String uri = "http://maps.google.com/maps?f=d&hl=en&saddr="+latitude1+","+longitude1+"&daddr="+latitude2+","+longitude2;
Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(uri));
startActivity(Intent.createChooser(intent, "Select an application"));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With