android绑定到AccessibilityService [英] android bind to AccessibilityService
问题描述
我创建了一个android服务,它是 AccessibilityService
。根据我的活动,我想绑定到该服务。没有进程间的通信,因此我尝试创建本地的 Binder
实现,该实现仅返回服务(如本例中的 http://developer.android.com/resources/samples/ApiDemos/src/ com / example / android / apis / app / LocalService.html )。
I have created an android service, which is an AccessibilityService
. From my activity, I would like to bind to that service. There is no inter process communication, so I have tried creating a local Binder
implementation that just returns the service (as in this example http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/LocalService.html).
问题是 onBind $ c $
AccessibilityService
中的c>是 final
,因此我无法覆盖它以返回本地活页夹。
The problem is that onBind
in AccessibilityService
is final
and I cannot override it to return my local binder.
这是否意味着要绑定到服务,我需要使用AIDL吗?
Does this mean I need to use AIDL if I want to bind to the service?
推荐答案
不,这意味着您无法绑定服务期限。您需要为AIDL覆盖 onBind()
。
No, it means that you cannot bind to the service, period. You would need to override onBind()
for AIDL.
这篇关于android绑定到AccessibilityService的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!