How to get BATTERY_PROPERTY_CHARGE_COUNTER on api 21 Android

118 Views Asked by At

Why does getIntProperty return zero on the api device 21

val batteryManager = context.getSystemService(Context.BATTERY_SERVICE) as BatteryManager
val BatteryCapacity = batteryManager.getIntProperty(BatteryManager.BATTERY_PROPERTY_CHARGE_COUNTER)
0

There are 0 best solutions below