How to create an Android Wear app with the note-taking voice action?

前端 未结 2 1957
温柔的废话
温柔的废话 2020-12-19 19:54

I can\'t seem to figure out how to create an Android Wear application which would allow me to use it to take notes via built-in voice actions. I declare the intent filter as

相关标签:
2条回答
  • 2020-12-19 20:45

    @Malcolm answer with add this line also. It will be working fine.

    <action android:name="com.google.android.gm.action.AUTO_SEND" />
    

    The full part is

    <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"/>
    <action android:name="com.google.android.gm.action.AUTO_SEND" />
    <data android:mimeType="text/plain"/>
    

    0 讨论(0)
  • 2020-12-19 20:46

    The trick is to include the category android.intent.category.DEFAULT, as stated in the documentation on intents. If it is missing, no implicit intents can be received by the app. Besides that, it is important to include the MIME type text/plain. The complete declaration is as follows:

    <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>
    
    0 讨论(0)
提交回复
热议问题