Forgive me I'm sure this has been covered but I searched couldn't find anywhere.
I want my program to stop playing music when the charger is plugged in, and start playing again when plugged in again etc.
How do I do these two things:
1. Check weather running battery/charging?
2. Handle an event for when this is charging status changed (eg. charging started/charging stopped) within my program?