<service android:name="com.xx.service.xxService" >
<intent-filter>
<action android:name="com.xx.service.xxService.Action" />
<data android:scheme="http" android:host="www.baidu.com" />
</intent-filter>
<intent-filter>
<action android:name="com.xx.service.xxService.Action" />
<data android:scheme="http" android:host="www.baidu.com" />
</intent-filter>
</service>
如果要配置多个data,path属性就不要写了,不然会引起很多不必要的麻烦。
本文介绍了如何在Android中配置Service及其Intent Filter,并通过具体的XML示例展示了如何指定action及data元素来实现特定的服务调用。同时强调了当配置多个data元素时避免使用path属性以防止出现问题。
35

被折叠的 条评论
为什么被折叠?



