How to detect alarm ringing or other apps using speaker? [closed]
问题 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. 回答1: I solved my problem for default alarm application: public static final String ALARM_ALERT_ACTION = "com.android.deskclock.ALARM_ALERT"; public static final String ALARM_SNOOZE_ACTION = "com.android.deskclock.ALARM