Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R.drawable cannot resolve image

I have checked a lot of questions on stackoverflow and I seem to have all the correct things but my R.drawable wont detect my image. It is in /res/drawable and in all the other folders (mdpi, hdpi etc.)

ShipImage = context.getResources().getDrawable(R.drawable.player);

And here is my R.java

    public static final class drawable {
        public static final int background=0x7f020000;
        public static final int buttons=0x7f020001;
        public static final int dead=0x7f020002;
        public static final int enemy=0x7f020003;
        public static final int ic_launcher=0x7f020004;
        public static final int play_btn=0x7f020005;
        public static final int player=0x7f020006;
    }
like image 339
Fasih Awan Avatar asked Jun 23 '12 20:06

Fasih Awan


1 Answers

Are you sure You import import com.yourcompanyname.product.R ?

instead of

import android.R;

like image 130
Samir Mangroliya Avatar answered Nov 13 '22 02:11

Samir Mangroliya