I am also new to android. This is what I have done, not sure if this is a good approach or not, but here it is...
In your button's onClick method do this:
public void rectangleClicked(View view)
{
Log.i("---Log---","Button clicked");
drawRectView.setValue("rectangle");
}
And in your DrawRectangleView class simply define a string variable and define a setter method:
public void setValue(String val) {
testVar = val;
}
After that simply if-else value of testVar. Hope this helps
P.S I think you should use on custom view rather than using two different views.