4

I am trying to add voice action to my music app. When I do the voice action and said:

Play Someone like you

enter image description here

Google voice search recognized it is a song and it let user chooses what apps to open this intent with (Which include my app). When clicking on my app, I received the sony name as expected.

I noticed that I can say:

Play Someone like you on Google Music

enter image description here

This would let Google voice search open Google Music directly, after a small timeout.

=-=-=

So what is not working is that I can not use Play [Music] on [My App]; this would give me a google search result.

enter image description here

I basically copied my code from this blog, I wonder if there are anything extra that I have to do in order for Play [Music] on [My App] to work?

This is my manifest file:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.github.kylelam.musicvoiceaction" >

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name" >
        <intent-filter>

            <action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH" />
            <category android:name="android.intent.category.DEFAULT" />


            <action android:name="android.intent.action.MAIN" />


            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

</manifest>
kaho
  • 4,746
  • 1
  • 16
  • 24

0 Answers0