开发者

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

开发者 https://www.devze.com 2023-04-13 00:38 出处:网络
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

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

精彩评论

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