这是我的代码
fun onclick(view: View) {
val numberRandom = (1..6).random()
textView1.text = "$numberRandom"
var mediaPlayer: MediaPlayer? = MediaPlayer.create(this, R.raw.rolll.wav)
mediaPlayer?.start() // no need to call prepare(); create() does that for you
}