Skip to content

Instantly share code, notes, and snippets.

@piyushgupta27
Last active December 12, 2016 13:44
Show Gist options
  • Save piyushgupta27/f754d8ccc671ae10a8011608cf2da6f2 to your computer and use it in GitHub Desktop.
Save piyushgupta27/f754d8ccc671ae10a8011608cf2da6f2 to your computer and use it in GitHub Desktop.
SmartScheduler.JobScheduledCallback callback = new SmartScheduler.JobScheduledCallback() {
    @Override
    public void onJobScheduled(Context context, Job job) {
        // Handle onJobScheduled here
    }
};

Job.Builder builder = new Job.Builder(JOB_ID, callback, jobType, JOB_PERIODIC_TASK_TAG) 
    .setRequiredNetworkType(networkType)
    .setRequiresCharging(requiresCharging)
    .setPeriodic(intervalInMillis)
    .build();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment