androidandroid-intentandroid-manifestwear-osgoogle-voice

Android Wear - Using "Take a note"


As Google describes in their Android Wear development docs, you can use an intent filter to access the voice command features for your app. For example, "Take a note" will launch one of your app's activities in order to take a note, as described here.

I have copied the example code exactly and placed it in my activity tag in my AndroidManifest.xml file. After I have uploaded my .apk to my Wear device, I should be able to select the default application to use the "Take a note" voice command in Google's Android Wear app. When I go to pick a default app for "Take a note", there are numerous apps available, but not mine. I figure there is something that Google didn't show me that I need to implement in my <intent-filter>, but I don't know what. If anyone has any ideas, that would be appreciated.

Thanks!

Edit: Here is my full Manifest

<?xml version="1.0" encoding="utf-8"?>

<uses-feature android:name="android.hardware.type.watch" />

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.DeviceDefault" >
    <activity
        android:name=".MainWearActivity"
        android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".NoteAddWearActivity"
        android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.SEND" />
            <category android:name="com.google.android.voicesearch.SELF_NOTE" />
        </intent-filter>
    </activity>
    <activity
        android:name=".NotesWearActivity"
        android:label="@string/app_name">
    </activity>
</application>


Solution

  • I have solved it:

    <intent-filter>
        <action android: name="android.intent.action.SEND />
        <category android:name="android.intent.category. DEFAULT />
        <category android:name="com.google.android.voicesearch.SELF_NOTE" />
        <data android:mimeType="text/plain" />
    </intent-filter>
    

    I found the answer here.