是否需要导出Android JobService?

时间:2018-01-20 00:07:38

标签: android

https://developer.android.com/reference/android/app/job/JobService.html

我正在实施一个Android JobService,但我很困惑它是否需要清单中的"android:exported=true"属性。

Google文档中几乎没有相关信息。 网络上的一些资源,例如这里的答案说它需要它。

how to call service in background, when application is close, that time continues work service and call api ?

1 个答案:

答案 0 :(得分:3)

不,它没有。

This sample app是我证明使用JobScheduler的几个之一。 android:exported="true"元素上没有<intent-filter>或任何<service>元素:

<service
  android:name=".DemoJobService"
  android:permission="android.permission.BIND_JOB_SERVICE" />

但您确实需要android:permission属性。