[英]Android MediaPlayer hangs my app
I've got quite a problem with MediaPLayer, i have really no idea, why this code doesn't work! 我在MediaPLayer上遇到了一个大问题,我真的不知道,为什么这段代码不起作用! Btw.
顺便说一句。 it doesn't work either on Samsung Galaxy Ace or emulator :( just getting "The application org.me.androidapplication11(process org.me.androidapplication11) has stopped unexpectedly. Please try again." help please!
它在Samsung Galaxy Ace或模拟器上均不起作用:(只是得到“应用程序org.me.androidapplication11(进程org.me.androidapplication11)意外停止。请重试。”请帮助!
package org.me.androidapplication11;
import android.app.Activity;
import android.os.Bundle;
import android.media.MediaPlayer;
public class MainActivity extends Activity {
private MediaPlayer mPlayer;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mPlayer=MediaPlayer.create(this,R.raw.as);
mPlayer.start();
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.