[Solved] How to start a service when another app gets active?


If You are specifically looking for starting your service when music player starts, take a look at AndroidManager API. You can register for callbacks using
registerAudioPlaybackCallback

Also there is method from same AudioManager which tells you if Music isActive
isActive – Stackoverflow

isMusicActive

solved How to start a service when another app gets active?