据documentaion在开发者论坛上,这是怎么了,我可以用AIDL绑定我的服务:绑定使用AIDL与绑定使用操作的服务?
/* Establish a couple connections with the service, binding by interface names.This allows other applications to be installed that replace the remote service by implementingthe same interface.*/
bindService(new Intent(IRemoteService.class.getName()),mConnection, Context.BIND_AUTO_CREATE);
现在我有一个应用程序,它具有服务类和AIDL接口。
和我有过,我希望访问服务类应用A的,在使用应用程序A暴露纽约AIDL
所以我创建完全相同pacakge应用B的内部AIDLs方法和具有粘贴AIDLs应用B从应用程序A.
但是,当我尝试使用上面提到的文档的机制来绑定服务它告诉我:
无法启动服务意向{行动com.example.service.MyService } U = 0:未找到
在应用程序A服务
导出= “真”。
这种方法我在应用中添加一个意图过滤器,以我的服务,并试图指定明确的意图使用
intent.setClassName(String packageName, String className)
而且现在它的工作现在insted的!
那么有什么我错过了,而提到原始文件?当接近将被使用?
IRemoteService.class.getName()返回什么?你是如何在清单中定义你的服务的? – pskink
请参阅我的问题开始时引用Android文档的链接。 http://developer.android.com/guide/components/aidl.html#Calling –
你没有回答,你是如何在清单中声明你的服务的? – pskink