0
我试图在接收到系统广播时使用接收器来获取关于电池的信息,但是它没有做任何事情就失败了。
下面是代码:
if (Intent.ACTION_BATTERY_CHANGED.equals(intent.getAction())) {//doing
如何在我的应用程序中获取电池信息?
1...
}
,并在AndroidManifest.xml
<receiver android:name=".BroadCastReceiver_battery">
<intent-filter>
<action android:name="android.intent.action.BATTERY_CHANGED" />
</intent-filter>
</receiver>
非常感谢您的帮助 – Sean 2011-01-07 09:02:48