📅  最后修改于: 2022-03-11 14:52:36.758000             🧑  作者: Mango
MediaPlayer mediaPlayer;
//In the onCreate Method
mediaPlayer = MediaPlayer.create(this, R.raw.alarmclockbuzzer);
//Sound file goes in "raw" folder in "res" folder
mediaPlayer.start(); //plays the mp3 sound (doesn't need to be in oncreate)