I have two classes: CustomView extends View and MainActivity extends Activity. In CustomView, I draw a series of rounded squares (canvas.drawRoundRect) using a loop . I know how to detect clicks on any given square but I don't know how to change a square's color. How do I call the onDraw method from MainActivity? Or if there is an update method I can use to invalidate() from the MainActivity class. Bottom line is I want to know how to change my shape's color whenever I click on it. Thank you.