Google Glass: Starting an activity with "Ok Glass, Command"

Viewed 1159

Using this code snippet, as directed by Google's guide, presents an additional voice input screen.

<activity
    android:name="ca.lvin.myfirstglassapp.MyPuppiesSlideshowActivity "
    android:label="@string/app_name" >
    <intent-filter>
        <action android:name="com.google.android.glass.action.VOICE_TRIGGER" />
    </intent-filter>
    <meta-data
        android:name="com.google.android.glass.VoiceTrigger"
        android:resource="@xml/my_voice_trigger" />
</activity>

What I want:

  1. "Ok, Glass"
  2. "Show me the pictures of puppies" (As per https://developers.google.com/glass/develop/gdk/ui/theme-widgets)
  3. MyPuppiesSlideshowActivity launches

What I'm getting:

  1. "Ok, Glass"
  2. "Show me the pictures of puppies"
  3. Microphone asking for more input is presented
  4. Say anything to the mic screen
  5. MyPuppiesSlideshowActivity launches

Can someone help me get rid of the two extra steps?

Related to this: Voice command for apps in Google Glass? but I couldn't comment on the original thread due to the lack of reputation...


Resolved!
I copied the code from this site verbatim
https://developers.google.com/glass/develop/gdk/input/voice

<trigger keyword="@string/glass_voice_trigger">
    <input prompt="@string/glass_voice_prompt" />
</trigger>

And the input tag was the problem. Removing it took care of the prompt.
Thank you!

1 Answers
Related