📜  在 kotlin 代码示例中将 rsw tesource 添加到 arrayList

📅  最后修改于: 2022-03-11 14:53:33.934000             🧑  作者: Mango

代码示例1
var sound: Uri = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.danger_alarm_sound)

val mediaPlayer: MediaPlayer
            mediaPlayer =
                MediaPlayer.create(
                    applicationContext,
                    sound
                )
            mediaPlayer.start()