The code that I posted above, works fine but there is still an issue ..., once the device's battery is fully charged, the status changes, and I lose the charging state.
Right now, I don't know how to detect that there's a charger pulgged in once the battery is fully charged.
Perhaps I should try to get the display's power safe state (I do not know its real name
) ?
Because when you plug the charger, the display increases its brightness, but I don't know how to do it.
Any idea ?
Thanks very much.
--
Ibán.