Question

I am trying to build an Android Service that should get notified when the user starts playing an MP3. I checked LogCat when I start playing a song and saw that the following Intent is logged:

Intent { act=com.android.music.PLAYBACK_VIEWER flg=0x4000000 cmp=com.android.music/.MediaPlaybackActivity }

I couldn't figure out how to write an IntentFilter to let my Service know that this event has occurred and let me know the name of the song that will be played. I searched Android reference but could not find anything on PLAYBACK_VIEWER.

Thanks,

C

Was it helpful?

Solution

I would do neither. First, none of this is part of the SDK and so may change at any point. Second, this will only work for the built-in media player application, not any third-party or OEM-supplied media players, and I expect more people to gravitate to those.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top