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

[ad_1]

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

[ad_2]

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