我does not require android.permission.BIND_JOB_SERVICE permission
在安排我的时候遇到错误JobService
,我已经拥有绑定权限。下面是我的代码。
JobScheduler jobScheduler = (JobScheduler) getSystemService(JOB_SCHEDULER_SERVICE);
ComponentName componentName = new ComponentName(MainActivity.this,MyJobService.class);
JobInfo.Builder jobInfo = new JobInfo.Builder(101, componentName).setPeriodic(2000);
jobScheduler.schedule(jobInfo.build())
<service
android:name=".MyJobService"
android:permission="android:permission.BIND_JOB_SERVICE"
android:exported="true"/>
错误:
java.lang.IllegalArgumentException:计划服务 ComponentInfo{services.acadglid.com.acadgildservices/services.com.es.MyJobService} 不需要 android.permission.BIND_JOB_SERVICE 权限