我想创建活动背景音乐,但MediaPlayer
不能重复播放 :( 为什么我MediaPlayer
的没有循环播放?
有我的代码:
MediaPlayer mediaPlayer;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.tersetetete);
mediaPlayer = new MediaPlayer();
mediaPlayer.setVolume(8f, 8f);
mediaPlayer.setLooping(true);
mediaPlayer = MediaPlayer.create(this, R.raw.fon);
mediaPlayer.start();
}