gpt4 book ai didi

android - 服务中的 Intent 过滤器

转载 作者:行者123 更新时间:2023-11-29 18:23:16 25 4
gpt4 key购买 nike

我的 list 文件中包含以下内容:

<service android:name=".Rotate" 
android:enabled="true"
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>
</service>

然而,按住搜索键不会激活 SEARCH_LONG_PRESS了。在我更换之前 <activity><service>当长按搜索键时,它曾经显示两个选项,一个是我的应用程序,另一个是 Google 语音搜索...现在它只是 Google 语音搜索。

最佳答案

那是因为 SEARCH_LONG_PRESS 不用于服务。它用于 Activity 。 Intent 系统(startActivity()startService()sendBroadcast())的每次使用都独立于其他。例如,您不能让服务响应 startActivity()

关于android - 服务中的 Intent 过滤器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4062838/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com