本文实例讲述了Android编程实现添加低电流提醒功能的方法。分享给大家供大家参考,具体如下:
特殊需求,检测电流是否正常。
监听如下广播:
Intent.ACTION_BATTERY_CHANGED
plugType = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, 0);
if(mLowElectricityRemind == null){
mLowElectricityRemind = new LowElectricityRemind(BatteryMeterView.this.getContext());
}
mLowElect