Is it possible to be notified in Android when the Audio system starts playing audio? it looks like 开发者_开发知识库i should wire up a BroadcastReceiver, but it's not clear what i would listen for. I could listen for the MediaPlayer intent, but that would only capture when that particular application was playing audio, not when a third party application played audio, etc.
Any ideas?
Looks like it's only available on android OS 2.2+ (froyo) via the AudioManager.OnAudioFocusChangeListener.
Can you hook into this listener events, for pre 2.2
requestAudioFocus() and abandonAudioFocus()
精彩评论