开发者

raw cannot be resolved or is not a field error (Eclipse/Android/Java)

For some odd reason I'm getting this error: raw cannot be resolved or is not a field

I'm trying to do the following

   MediaPlayer click = MediaPlayer.create(this, R.raw.button_click.mp3);

in my onCreate method.

I've checked the fold开发者_如何转开发er & mp3 file, and it's <project-name>/raw/button_click.mp3. I've tried:

  • Cleaning up my project
  • Restarting Eclipse
  • Making it R.raw.button_click
  • Checking if everything's lowercased & spelled correctly

Help, please!


Shouldn't it be in projectname/res/raw, instead of projectname/raw?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜