简体   繁体   English

Android MediaPlayer挂起我的应用程序

[英]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();
}

}

You can debug your app using logcat. 您可以使用logcat调试应用。 I don't know if you're developing in Eclipse, but if you are, this link might help you. 我不知道您是否正在使用Eclipse开发,但是如果您正在使用Eclipse,则链接可能会对您有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM