简单明了的问题:
在Android Manifest中,IntentService是作为常规服务声明的,还是有其他方法?我尝试搜索了一下,但是没有找到答案。
这是一个普通服务声明的示例:
<service
android:name=".NameOfService">
</service>
谢谢
简单明了的问题:
在Android Manifest中,IntentService是作为常规服务声明的,还是有其他方法?我尝试搜索了一下,但是没有找到答案。
这是一个普通服务声明的示例:
<service
android:name=".NameOfService">
</service>
谢谢
android:name=".Communication"
进行标识。这意味着您的服务类应该位于 com.exercise.AndroidClient.Communication
中。com.exercise.AndroidClient
,并且您的服务类位于 com.exercise.AndroidClient.services.Communication
中,则需要像这样声明服务:<service android:enabled="true" android:name=".services.Communication" />
或者指定完整的包:
<service android:enabled="true" android:name="com.exercise.AndroidClient.services.Communication" />
没有任何区别,与常规的相同。
这是我的。
<service android:name=".MyIntentService" android:icon="@drawable/icon" android:label="@string/app_name" android:enabled="true"/>
如果你的不起作用,试试这样做:
<service android:name="com.my.qualified.MyIntentService" android:icon="@drawable/icon" android:label="@string/app_name" android:enabled="true"/>
编辑
当你进入 设置 >> 应用程序 >> 运行服务 页面时,会显示正在运行的服务列表。
android:icon将是缩略图图像
而 androin:label 将是显示文本