public static interface Battery.OnPluggedStateListener
| Modifier and Type | Method and Description |
|---|---|
void |
onPluggedToPowerSource(android.content.Context context,
Battery battery)
Invoked whenever the battery has been plugged into some power source.
|
void |
onUnpluggedFromPowerSource(android.content.Context context,
Battery battery)
Invoked whenever the battery has been unplugged from power source.
|
void onPluggedToPowerSource(android.content.Context context,
Battery battery)
Battery.getPluggedState().
Note, that there need to be registered BatteryPluggedStateReceiver via
Battery.registerBatteryReceiver(Context, int) with Battery.RECEIVER_BATTERY_PLUGGED_STATE
to receive this callback.
context - Current application context.battery - Battery with the actual data.void onUnpluggedFromPowerSource(android.content.Context context,
Battery battery)
Note, that there need to be registered BatteryPluggedStateReceiver via
Battery.registerBatteryReceiver(Context, int) with Battery.RECEIVER_BATTERY_PLUGGED_STATE
to receive this callback.
context - Current application context.battery - Battery with the actual data.