JobScheduler not having schedule options in Android Kotlin

75 Views Asked by At

I am trying to use JobSchedule in Android Kotlin but not getting the schedule method in JobScheduler.

Here is my code

val jobScheduler = applicationContext
                .getSystemService(JOB_SCHEDULER_SERVICE) as JobScheduler
            val componentName = ComponentName(this, JobScheduler::class.java)
            val jobInfo = JobInfo.Builder(12, componentName)
                .setRequiredNetworkType(JobInfo.NETWORK_TYPE_ANY)
                .build()
            jobScheduler.schedule(jobInfo)

I am getting error when using the schedule method of JobScheduler

0

There are 0 best solutions below