重写搜索龙preSS [英] Overriding Search Long Press

查看:118
本文介绍了重写搜索龙preSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在众多Android手机,当用户长时间presses的搜索按钮,它启动了谷歌语音搜索的意图。如何可以覆盖此功能在整个系统,而不仅仅是覆盖搜索按钮长presses从活动中?更具体地讲,我如何才能增加我的应用程序是相同类型的意图是谷歌语音搜索,以便它显示为选择应用程序选项时,搜索按钮是pssed长$ P $。非常感谢!

On many Android phones, when a user long presses the Search button, it launches the Google Voice Search intent. How can override this feature across the entire system, not just overriding Search button long presses from an activity? More specifically, how can I add my app to be the same type of intent as Google Voice Search so that it shows up as a "Choose Application" option when the Search button is long pressed. Thanks a lot!

推荐答案

尝试使用android.intent.action.SEARCH_LONG_ $ P $干燥综合征与类别为android.intent.category.DEFAULT在你行动的意图过滤器在你的Andr​​oidManifest.xml

Try using "android.intent.action.SEARCH_LONG_PRESS" as your action with the category as "android.intent.category.DEFAULT" under your intent-filters in your AndroidManifest.xml

<application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".YourActivityName" android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.SEARCH_LONG_PRESS" />
                <category android:name="android.intent.category.DEFAULT" /> 
            </intent-filter>
        </activity>

    </application>

这篇关于重写搜索龙preSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆