Reputation: 790
Is it possible to schedule a job to begin at device bootup using JobScheduler?
Or do I have to use BroadcastReceivers instead?
Upvotes: 0
Views: 138
Reputation: 409
You can do it by setting the setPersisted(true)
on the JobInfo
object.
Check the official documentation.
Keep in mind that you still need the RECEIVE_BOOT_COMPLETED
permission though.
Upvotes: 0
Reputation: 8184
From my experience you can only do it using BroadcastReceiver
. JobScheduler
are good when you want to run something based on some conditions, not events (actions).
Upvotes: 1