Graphics tutorial / drawLine() query

Hi all,

I am trying to draw lines on my watch face and it simply is not happening for me. In fact, none of the dc methods for drawing do anything at all.

I am able to draw using layout.xml. Everything in the xml files is drawn yet everything I try to draw using dc calls does not get drawn.

Where am I going wrong?
  • You cannot call View.onUpdate(dc) after any calls to dc.

    Call dc statements after the View.onUpdate call.


    Like Hermo said, delete the View.onUpdate(dc) from where it is, and replace the dc.clear() with View.onUpdate(dc).


    Assuming that widthX and widthY are what I think, moving the View.onUpdate() call up to replace the call to dc.clear() isn't sufficient. The first dc.fillRectangle() call is essentially a call to dc.clear() and it needs to be removed as well.


    Hi guys,

    Thank-you so much for this "order of operations" information. I am now able to draw things on top of my static layout! (the watch hands)