小编Mat*_*2ee的帖子

JobScheduler两次发布职位(未预期)

我正在写一篇关于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)

android android-jobscheduler

11
推荐指数
1
解决办法
2926
查看次数

标签 统计

android ×1

android-jobscheduler ×1