概述
I have two separate applications and ideally I would like to use an IntentFilter to bind to the service on the second application. Is this possible?
In app 1 Manifest:
android:name=".ServiceName"
android:exported="true"
android:icon="@drawable/ic_launcher"
android:label="Bound Service" >
In app 2 Activity:
It is currently :
@Override
protected void onResume() {
super.onResume();
Intent i = new Intent();
i.setComponent(new ComponentName("com.test.application1", "com.test.application1.ServiceName"));
bindService(i, mConnection, Context.BIND_AUTO_CREATE);
}
Is it possible to work like this :
@Override
protected void onResume() {
super.onResume();
IntentFilter filter1 = new IntentFilter("IntentFilterName");
bindService(filter1, mConnection, Context.BIND_AUTO_CREATE);
}
I get the following error:
The method bindService(Intent, ServiceConnection, int) in the type ContextWrapper is not applicable for the arguments (IntentFilter, ServiceConnection, int)
最后
以上就是秀丽手链为你收集整理的android service中intentfilter,Android bind service with intent filter的全部内容,希望文章能够帮你解决android service中intentfilter,Android bind service with intent filter所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复