Created
January 19, 2017 20:38
-
-
Save brendan-fahy/5c8ce6a3c6508ad3cd502fa7ff3b7845 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
val intentFilter = IntentFilter(Intent.ACTION_BATTERY_CHANGED) | |
val batteryStatus = context.registerReceiver(null, intentFilter) | |
val status = batteryStatus.getIntExtra(BatteryManager.EXTRA_STATUS, -1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment