How to stop other apps playing music from my current activity?

后端 未结 2 1150
悲&欢浪女
悲&欢浪女 2020-11-28 09:30

In my app I am trying to make a button which when clicked stops all other apps that are playing music. What I want is similar to that if I am playing music through one music

2条回答
  •  旧时难觅i
    2020-11-28 10:11

    You need to use the media players audio focus implementations found in the docs here:

    http://developer.android.com/guide/topics/media/mediaplayer.html#audiofocus

提交回复
热议问题