I would like to have two activities. FirstActivity
should be started from
launcher (by tapping on icon) and SecondActivity
should be started by voice
command (by saying "OK Google, start play example").
The problem is that for my current configuration only FirstActivity
is
started. Also method isVoiceInteraction
returns false
. I also don't see any values in flags
that indicates that activity was started by voice.
Here's part of AndroidManifest.xml
:
<application android:label="play example">
<activity android:name="com.example.FirstActivity" android:label="play example">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="com.example.EXAMPLE_ACTION" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.example.SecondActivity" android:label="play example">
<intent-filter>
<action android:name="com.example.EXAMPLE_ACTION" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.VOICE" />
</intent-filter>
</activity>
</application>
Here it states:
To specify the text to say after "Start", specify a label attribute for the activtiy that you want to start.
But when I change label
for SecondActivity
it does not help.
I'm using API version 26.
How to setup configuration to handle described behavior?