• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Working with canvas

AlysiumX

Lurker
I am trying to learn how to use canvas in android. Every site I went to has something similar to this :

Code:
 @Override
        public void onDraw(Canvas canvas) {
            Bitmap _scratch = BitmapFactory.decodeResource(getResources(), R.drawable.icon);
            canvas.drawColor(Color.BLACK);
            canvas.drawBitmap(_scratch, 10, 10, null);
        }

but when I try to do this, it gives me an error because I am not defining its super class. So my question is how are other getting away with it? and how do I get past this?

Thanks.
 
Back
Top Bottom