It's easy to detect when phone calls arrive (via phoneStateListener), but what about other notifications like email or sms?
On some devices, these notification sounds are muted, but do not pause any current media player instances that annoy the user. Ideally, I would like to listen to notifications that play sound, pause playback for a duration, and then resume playback afterwards.
Gdorn source
share