播放raw文件内的音频文件出现问题

package com.example.music2;

import android.R;
import android.app.Service;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.IBinder;

public class music extends Service {

private MediaPlayer MediaPlayer;

@Override
public IBinder onBind(Intent arg0) {

    return null;
}

@SuppressWarnings("deprecation")
@Override
public void onStart(Intent intent, int startId) {
    // TODO Auto-generated method stub
    super.onStart(intent, startId);
    MediaPlayer=MediaPlayer.create(this, R.raw.test); //这个地方的test会标红
    MediaPlayer.start();
}


@Override
public void onDestroy() {
    super.onDestroy();
    MediaPlayer.stop();
}

}


麻烦大家帮我看看,不胜感激

http://download.csdn.net/download/qq_36893734/9732227

test文件,应该放在res目录下的raw文件夹中

你试试创建一个英文的目录

test文件应该放在res目录下的raw文件夹中,具体操作http://download.csdn.net/download/qq_36893734/9732227

如果你确定了你的音频文件已经放到的了res/raw目录下,但是还是标红的话,你可以运行一下试试,可能是他还没有刷新图片说明