开发者

How to handle a call in android media player? [duplicate]

开发者 https://www.devze.com 2023-04-13 07:36 出处:网络
This question already has an answer here: Closed 11 years ago. Possible Duplicate: Android 2.1+ Pause for incoming/outgoing call, resum开发者_JS百科e when done
This question already has an answer here: Closed 11 years ago.

Possible Duplicate:

Android 2.1+ Pause for incoming/outgoing call, resum开发者_JS百科e when done

I have created a mediaplayer in android and everything works fine except that the player keeps on playing when i receive a call. To handle a call i think we should use broadcast receiver and listen to phone state. But being a beginner i couldnt figure out how to implement it?.Please help

thanks


You'll want to set up PhoneStateListener, specifically paying attention to "onCallStateChanged method, and send commands to the media player as appropriate based on call state (pause when ringing, resume after hangup if so desired, etc).

0

精彩评论

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

关注公众号