Android Custom Layout - onDraw() never gets called
public class MainActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); TableView tv = new TableView(this); tv.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT)); setContentView(tv); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.activity_main, menu); return true; } } public class TableView extends ViewGroup { private Paint oval; private RectF rect; public TableView(Context context) { super(context); oval= new Paint(Paint.ANTI_ALIAS_FLAG); oval