响应导航提醒
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
在 Navigation 模板中,您可以使用导航提醒,让用户了解交通事件等突发事件,并采取相应措施做出响应。
通知提醒会显示在通常用于预计到达时间 (ETA) 的位置,因此不会妨碍导航路线。它们可让用户轻松选择如何响应提醒。
示例流程
用户操作 |
执行操作的位置 |
操作之后的步数 |
在用户导航时,应用会了解路线前方的路况。 |
导航模板

|
1 |
系统会显示导航提醒(而不是预计到达时间)来警告用户并提供重新规划路线的选项,而进度指示器会跟踪提醒自动关闭的时间。 |
导航模板(刷新)

|
1 |
超时后,提醒会被关闭。 |
导航模板(第二次刷新)

|
1 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eThe navigation template uses alerts to inform users about traffic incidents and allows them to take action.\u003c/p\u003e\n"],["\u003cp\u003eNavigation alerts temporarily replace the estimated time of arrival (ETA) and provide options, such as rerouting.\u003c/p\u003e\n"],["\u003cp\u003eThese alerts automatically dismiss after a set time, ensuring the navigation route remains visible.\u003c/p\u003e\n"]]],[],null,["# Respond to a navigation alert\n\n\u003cbr /\u003e\n\nOn the\n[Navigation template](/cars/design/create-apps/apps-for-drivers/templates/navigation-template),\nyou can use a\n[navigation alert](/cars/design/create-apps/apps-for-drivers/templates/navigation-template#alerts)\nto let users know about incidents such as traffic events and take actions in\nresponse.\n\nNotification alerts appear in the spot normally used for the estimated\ntime of arrival (ETA), so they don't block the navigation route. They allow\nusers to make a simple choice about how to respond to the alert.\n\nSample flow\n-----------\n\n| User action | Where action is performed | Step count after action |\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------|-------------------------|\n| While the user is navigating, the app learns about a traffic event ahead on the route. | Navigation template | 1 |\n| A navigation alert appears instead of the ETA to warn the user and offer an option to reroute, while a progress indicator tracks the time until automatic dismissal of the alert. | Navigation template (refresh) | 1 |\n| The alert is dismissed after it times out. | Navigation template (second refresh) | 1 |"]]