开发者

Android: Launch Google Maps App

开发者 https://www.devze.com 2023-03-01 15:35 出处:网络
I saw in another Stack Overflow post you can open the Google maps appl开发者_JAVA百科ication from your application by passing two address as parameters in the URL.

I saw in another Stack Overflow post you can open the Google maps appl开发者_JAVA百科ication from your application by passing two address as parameters in the URL.

String url = "http://maps.google.com/maps?saddr=some+address&daddr=another+Address"
Intent intent = new Intent(android.content.Intent.ACTION_VIEW,  Uri.parse(url));

How can you start the Google maps application from your app and get directions from your current location to an address?


Absolutely, but you'll have to grab your location via GPS coordinates first. Or, just set the position of the second location and let the user tap it and find directions from their current position using Maps itself.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号