Jobscheduler not starting job

1495
August 28, 2017, at 3:33 PM

I made a class RefreshService that extends JobService, and in it I have a static method scheduleJob():

public static void scheduleJob(final Context context) {
    final JobScheduler jobScheduler = (JobScheduler) context.getSystemService(Context.JOB_SCHEDULER_SERVICE);
    final ComponentName refreshService = new ComponentName(context, RefreshService.class);
    final JobInfo.Builder jobBuilder = new JobInfo.Builder(1002, refreshService);
    jobBuilder.setRequiredNetworkType(JobInfo.NETWORK_TYPE_ANY);
    jobBuilder.setRequiresDeviceIdle(false);
    jobBuilder.setRequiresCharging(false);
    jobBuilder.setMinimumLatency(5000L);
    jobBuilder.setOverrideDeadline(5000L);
    final JobInfo job = jobBuilder.build();
    jobScheduler.schedule(job);
}

And in my android manifest I put this:

    <service
        android:name="<my full package path>.RefreshService"
        android:permission="android.permission.BIND_JOB_SERVICE"
        android:exported="true" />

I have overriden onStartJob and onStopJob to do what I need of the service, but yet onStartJob does not ever get called.

Is there something I'm missing out?

READ ALSO
React Native navigate on button press

React Native navigate on button press

I am new to React Native, an I am wanting to navigate to a new page on a button pressI have created my own custom button for reuse between screens

52
How to programmtically get value of built-in resources like colorAccent?

How to programmtically get value of built-in resources like colorAccent?

How do you get the actual value of a referenced colorIn a layout I can use the following

40
Crash when inflating a layout that sets the TextView.TextColor

Crash when inflating a layout that sets the TextView.TextColor

I cannot inflate a layout if that layout sets the textColor of a TextView to the following

73
Titanium: Memory leak in hello world application

Titanium: Memory leak in hello world application

I have the following basic Titanium Alloy application:

56