Created
January 19, 2017 21:49
-
-
Save brendan-fahy/c830a9a026625da02c7bdc9dd3935a7e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun onStartJob(jobParams: JobParameters): Boolean { | |
val intentFilter = IntentFilter(Intent.ACTION_BATTERY_CHANGED) | |
val batteryStatus = registerReceiver(null, intentFilter) | |
notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager | |
notificationManager.notify(Constants.NOTIFICATION_ID, buildNotification(batteryStatus)) | |
jobFinished(jobParams, false) | |
return false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment