I am trying to learn how to use canvas in android. Every site I went to has something similar to this :
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.
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.