I am developing a music app. I want to detect that other apps using speaker or alarm ringing for play/pause music.
For phone call i use PhoneStateListener. I tryed OnAudioFocusChangeListener for to detect other audios. But didn't work.
I wondering how to solve this problem.
I solved my problem for default alarm application: