问题
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