How to know which music player is currently playing the song in android

*爱你&永不变心* 提交于 2019-12-23 03:55:30

问题


I want to know that which music player is currently playing the music. Also i want to know that at current time if music is paused.

Actually, I want to play the music on connecting the headphone if any music is currently paused.

I have succeeded in it but upto a little extent: 1. I am able to play music when I connect the headphone even if no music was paused at that time. 2. I set 2 music player at same time with different songs playing. When I removed headphone, the music stopped, but when I plugged headset, the music from other music app resumed.

So I want to know two things: 1. Is any music paused at current time. 2. If any music is playing on my device, then which music player is running that music.

Any help will be highly appreciated.

Thank you in advance.

来源:https://stackoverflow.com/questions/33201891/how-to-know-which-music-player-is-currently-playing-the-song-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!