Android: R.drawable not showing my image?

Andy Hin picture Andy Hin · May 1, 2011 · Viewed 12.4k times · Source

In my android 2.2 app, I've added my image to the res/drawable-mdpi folder. However, I cannot seem to access it using R.drawable.. As far as I know, there isn't any additional configuration I need to do - any help?

Answer

Andy Hin picture Andy Hin · May 3, 2011

I figured this out. The issue was that the project was importing android.R instead of using the generated R file - if you encounter this problem, check your imports to make sure the correct package/file is being imported.