gpt4 book ai didi

android - 服务 Intent 必须明确 : Intent

转载 作者:行者123 更新时间:2023-11-29 14:46:14 24 4
gpt4 key购买 nike

<分区>

我正在尝试制作一个 RemoteService ,我遵循了本指南: http://www.techotopia.com/index.php/Android_Remote_Bound_Services_%E2%80%93_A_Worked_Example

这是我在 list 中的服务声明:

 <service android:name=".RemoteService"
android:process=":InnolertRemoteProcess"
android:exported="true">
<intent-filter>
<action android:name="myService.RemoteService"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</service>

这就是我从我的客户端应用程序绑定(bind)到服务的方式:

Intent intent = new Intent("myService.RemoteService");
bindService(intent, myConnection, Context.BIND_AUTO_CREATE);

我得到这个异常:

  java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=myService.RemoteService }

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