开发者

Android: Getting Notified when Audio is Played

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()

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜