I tried to use a receiver to get Information about battery when received a system broadcast, but it failed without doing anything.
Here is the code:if (Intent.ACTION_BATTERY_CHANGED.equals(intent.getAction()))
{//doing
1...
}
and in AndroidManifest.xml
<receiver android:name=".BroadCastR开发者_Go百科eceiver_battery">
<intent-filter>
<action android:name="android.intent.action.BATTERY_CHANGED" />
</intent-filter>
</receiver>
quasharou ,
I found this tutorial useful
Hope it helps .
精彩评论