摘要:
1、创建BroadcastReceiver对象,重写onReceive()方法首先获取Action事件,当判断该事件为Intent.ACTION_BATTERY_CHANGED时,获取手机当前电量和总电量BroadcastReceiver br=new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { // TODO Auto-generated method stub String s=intent.getAction(); if(Intent.A... 阅读全文