我正在写一篇关于JobScheduler的教程,我发现了一个奇怪的行为.我要求在1秒内安排3个不同的作业(.setOverrideDeadline(1000)),但它们都被提交并运行了两次......所以这里的代码:
public class MyApplication extends Application {
private static final int JOB_ID_HanlderThread = 100;
private static final int JOB_ID_ExecutorService = 200;
private static final int JOB_ID_AsyncTask = 300;
JobScheduler mJobScheduler;
ExecutorService myExecutorServiceForJobs=null;
private static MyApplication INSTANCE;
public static MyApplication getInstance(){
return INSTANCE;
}
/**
* Called when the application is starting, before any activity, service,
* or receiver objects (excluding content providers) have been created.
* Implementations should be as quick as possible (for example using
* lazy initialization of …
Run Code Online (Sandbox Code Playgroud)