gpt4 book ai didi

java - 从谷歌地图重定向到我的应用程序?

转载 作者:太空狗 更新时间:2023-10-29 14:35:22 25 4
gpt4 key购买 nike

当源位置和目标位置相同时需要从默认谷歌地图重定向到我的应用程序

我正像这样从我的应用程序转到谷歌地图,但我无法从谷歌地图返回我的应用程序。

intent = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("http://maps.google.com/maps?saddr=17.464600,78.366630&daddr=17.450970,78.381660"));
startActivity(intent);

最佳答案

我不确定您是否可以这样做,因为谷歌地图没有对您的应用程序的引用。我做了类似的事情。我用过这个。

<fragment
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:map="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="Your Context"
tools:openDrawer="start">
</fragment>

可以看到这个LINK .这个教程好像还不错。它对我有用。

关于java - 从谷歌地图重定向到我的应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57248382/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com