Java 从谷歌地图重定向到我的应用程序?
当源位置和目标位置相等时,需要将默认谷歌地图重定向到我的应用程序 我正在像这样从我的应用程序迁移到谷歌地图,但我无法从谷歌地图返回到我的应用程序Java 从谷歌地图重定向到我的应用程序?,java,android,Java,Android,当源位置和目标位置相等时,需要将默认谷歌地图重定向到我的应用程序 我正在像这样从我的应用程序迁移到谷歌地图,但我无法从谷歌地图返回到我的应用程序 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"));
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>
你可以看到这个。本教程看起来相当不错。这对我有用