I was following the video for JobScheduler
:
https://www.youtube.com/watch?v=XFN3MrnNhZA
But lint was giving me that context.getSystemService(class)
is api 23.
So am I missing something or did android change something with there api?
Note: Mostly wondering if JobScheduler
was introduced in api 21
how would it work without getSystemService(Class)
Thanks.
Came here with a similar problem for NotificationManager. What I ended up doing was
val notificationManager =
ContextCompat.getSystemService(
requireContext(),
NotificationManager::class.java
) as NotificationManager
Thanks to Reghunandan I found a better solution for my problem by using:
github.com/firebase/firebase-jobdispatcher-android
But if any body got same problem here is the mistake:
getSystemService(Class) API 23
Should be:
getSystemService(String) API 1
getSystemService(context.JOB_SCHEDULER_SERVICE) API 21
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With