Playing BG Music Across Activities in Android

后端 未结 6 879
南方客
南方客 2020-11-27 06:27

Hello! First time to ask a question here at stackoverflow. Exciting! Haha.

We\'re developing an Android game and we play some background music for our intro

6条回答
  •  醉梦人生
    2020-11-27 07:11

    You can try using the AsyncPlayer but you should keep a reference to the class in order to stop the sound from playing.

    You can create a Uri to a local resource using Uri uri = Uri.parse("android.resource://com.stackoverlof.android/raw/ beep.mp3");.

    Hope this helps.

提交回复
热议问题