If you are using a custom ViewGroup
, you have to implement the onLayout
method to display anything.
ViewGroup
is just a base class for other layouts, it does not do anything by itself. I would advise to use one of its descendant, like FrameLayout
or LinearLayout
.
If you are creating a drawing application, you might be better using a Canvas
instead of using a custom layout. Canvas
already provides several methods to draw lines, circles, rectangles, etc. You will have some work to do if you want to be able to move one element afterwards though.