I'm writing a basic music player app but having some problems when it comes to handling the app state transitions. …