Skip to content

Instantly share code, notes, and snippets.

@DanishAmjad12
Created September 5, 2018 07:50
Show Gist options
  • Save DanishAmjad12/e27c866f16b18dce65c3c7945a3ec9a5 to your computer and use it in GitHub Desktop.
Save DanishAmjad12/e27c866f16b18dce65c3c7945a3ec9a5 to your computer and use it in GitHub Desktop.
class AlarmJobIntentService : JobIntentService() {
override fun onHandleWork(intent: Intent) {
/* your code here */
/* reset the alarm */
// Util.showDebugLog("setAlarmCtx", "started Bottom")
AlarmReceiver.setAlarm(false)
stopSelf()
}
companion object {
/* Give the Job a Unique Id */
private val JOB_ID = 1000
fun enqueueWork(ctx: Context, intent: Intent) {
JobIntentService.enqueueWork(ctx, MyFcmListenerService::class.java, JOB_ID, intent)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment