Drawing an image in android
<p>I'm trying to just draw a simple image from the drawable-mdpi folder in android but I keep getting an error saying droid_1 cannot be resolved or is not a field, droid_1 is the name of the image, this is my code, </p>

<p>thanks for any help.</p>

<pre><code>import android.R;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.view.View;

public class GameView extends View {
    private Bitmap bmp;

    public GameView(Context context) {
        super(context);
        bmp = BitmapFactory.decodeResource(getResources(), R.drawable.droid_1);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        canvas.drawColor(Color.BLACK);
        canvas.drawBitmap(bmp, 10, 10, null);
    }
}
</code></pre>
