So I have this class which extends an activity. But I want to draw something on the screen, so I need to make a canvas. However I can’t extends View, because it’s an activity allready. What should I do?
My activity has the onClick method which I use to do some stuff, but what I wanna do is draw a simple image when I call the onClick method as well.
Thanks.
public class Stuff extends Activity implements OnClickListener {
@Override
protected void onCreate(Bundle savedInstanceState) {
(...)
}
@Override
public void onClick(View arg0) {
(...)
}
STEP 1: create a class by extends View as:
STEP 2: In Your Stuff Activity :
STEP 3: Your Activity main.xml as :
and finally try to search on google before asking question here.thanks