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内容请搜索靠谱客的其他文章。
发表评论 取消回复