重新启动设备后未调用JobIntentService#onHandleWork

时间:2019-05-09 05:32:13

标签: android android-service android-9.0-pie jobintentservice

重新启动设备后未调用

JobIntentService#onHandleWork

代码

            Intent intent1 = new Intent();
            intent1.setAction(intent.getAction());
            intent1.putExtra(Intent.EXTRA_INTENT, intent);
            enqueueWork(context, ManagerJobIntentService.class, JOB_ID, workIntent);

覆盖onStartCommand()

@Override
public int onStartCommand(@Nullable Intent intent, int flags, int startId) {
    super.onStartCommand(intent, flags, startId);

    return(START_REDELIVER_INTENT);
}

onHandleWork()

@Override
protected void onHandleWork(@NonNull Intent intent) {
    LogUtil.d(TAG, "onHandleWork() method " + intent);
}

以上代码运行正常!重新启动后,未调用设备onHandleWork()

  
    

设备:三星s9,s8(Android 9)

  

0 个答案:

没有答案