1

我正在使用 UI 中的下拉菜单在 android 中进行 mapbox 导航,并且我想在用户导航到某个地方后启动一个新活动来显示有关某个地方的信息。我该怎么做?完成后是否有关闭导航视图的处理程序,还是我必须依靠用户按下导航屏幕底部的取消按钮?

4

2 回答 2

1

0.6.2(或 6.3)版本目前不支持 UI 完成后的回调。因为0.7.0我们已经努力将其转换为可以在任何或中膨胀NavigationView的实际值。 ViewActivityFragment

如何做到这一点的一个例子是NavigationActivityhttps ://github.com/mapbox/mapbox-navigation-android/blob/master/libandroid-navigation-ui/src/main/java/com/mapbox/services/android/导航/ui/v5/NavigationActivity.java

您会看到导航会话被取消/完成时触发的回调。

于 2017-10-27T23:42:34.867 回答
0

There are a few ways you can detect whether the user has reached their destination or not. Either using the OnProgressChange and checking the routeProgress.distanceRemaining() is greater than 99%. You could also add a milestone to your navigation session and have it notify you when the sessions complete

于 2017-10-23T15:45:13.747 回答