Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/350.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 从谷歌地图重定向到我的应用程序?_Java_Android - Fatal编程技术网

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>

你可以看到这个。本教程看起来相当不错。这对我有用