Voice Action Activity

Hi All,

I'm developing an app, let's say "My App," that I'd like to be launched via the launcher and via voice using "Ok Google, start My App"

What I'd like to accomplish is to start MainActivity or VoiceActivity depending on the mode in which my app is launched. I found this blog post (https://blog.xamarin.com/add-a-conversation-to-your-android-app-with-voice-interactions/) by @JamesMontemagno but whenever I activate My App via "OK Google" it always starts at MainActivity.

I'm hoping someone can provide pointers on what intent-filters to add in order to accomplish this. Here's what I have so far:

 <activity android:icon="@drawable/icon" android:label="My App" android:name="md593b8d625023f6802361dd1b8a6546be5.MainActivity">
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    <activity android:label="My App" android:name="md593b8d625023f6802361dd1b8a6546be5.VoiceActivity">
        <action android:name="android.intent.action.VOICE_COMMAND" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.VOICE" />

Thanks in advance for any insight you can provide, I've been banging my head trying to figure out what should be seemingly very easy...



Sign In or Register to comment.