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

為{幸葍}努か 提交于 2019-11-29 11:56:00

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>

@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"/>

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!