您可以在单独的流程上启动JobIntentServcice吗?

时间:2018-08-17 16:12:46

标签: android android-service

我尝试在一个单独的进程上启动JobIntentServcice,但是没有调用onHandleWork()。

Manifest.xml

<service
        android:name=".service.MyService"
        android:exported="false"
        android:permission="android.permission.BIND_JOB_SERVICE"
        android:process=":myservice">
</service>

MyService.java

public class MyService extends JobIntentService {
  public static final int JOB_ID = 1001;

  public static void start(Context context) {
    JobIntentService.enqueueWork(context,
        MyService.class,
        MyService.JOB_ID,
        new Intent(context, MyService.class));
  }

  @Override
  protected void onHandleWork(@NonNull Intent intent) {
    // Handle intent here.
  }
}

是否可以在单独的进程上启动JobIntentService?

0 个答案:

没有答案