No connectivity message in “ok glass” menu

2019-05-18 08:50发布

问题:

I am developing an app which adds a live card into the timeline when the user selects the option from menu, like the sample apps do. I noticed that, when you don't have any connectivity, the native apps on the glass, like Google, show "No network connectivity" message in the "ok glass" menu and it is not possible to run them.

I would like to replicate this behavior. Is there a way to do this with the GDK API?

回答1:

You can do this by adding the network constraint to your voice trigger, as described in the GDK Voice Input documentation. For example:

<trigger keyword="@string/your_voice_trigger">
    <constraints network="true" />
</trigger>