从我的应用程序打开谷歌地图活动,如果用户到达目的地,则将用户重定向到我的应用



我想打开谷歌地图逐圈方向屏幕上的按钮点击并想检查用户是否到达目的地重定向用户到我的应用程序当前我正在使用此代码打开谷歌地图

            String uri = String.format(Locale.ENGLISH, "geo:0,0?q="+ destinationLoc.latitude+","+destinationLoc.longitude
                    + "(The Embroidery Store)" );
            Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            context.startActivity(intent);

我想在用户到达目的地后将其重定向到我的应用程序。

您可能需要了解地理围栏的概念。以下链接可能会有所帮助:https://developer.android.com/training/location/geofencing.htmlhttps://github.com/googlesamples/android-Geofencing

最新更新