CIQ 4.x.x call a clear() of Dc before onUpdate() in a real device fr265, but not in a sim

How can I avoid this clear() in WatchFace type App?

Firstly, I thought that one extra Layer was added by real waches for overlaying some system draws, but the getLayers() function in a real device return null in my onUpdate(). So, there are no layers at all, but if draw something once in Dc, it will be cleared in device, but will show in simulator. Also, there are no layouts in app.

I want to keep anything after onUpdate drew something.

class TestWatchView extends WatchUi.WatchFace {
    var isNeedDraw;
    function onUpdate(dc as Dc) as Void {
        if (isNeedDraw) {
            dc.setColor(Graphics.COLOR_BLUE, Graphics.COLOR_BLACK);
            dc.setPenWidth(5);
            dc.drawCircle(208, 208, 50);
            isNeedDraw = false;
        }
}
  • and this one:
    function onLayout(dc as Dc) as Void {
        isNeedDraw = true;
    }
    that is all, no extra code in view, but the device clears the view, whereas a simulator doesn't. 
  • On some devices the dc is cleared before onUpdate() is called, but the sim doesn't reflect which devices so thia.  It's been the case for years.

    But, as a general rule, you always want to redraw everything each time onUpdate is called.  There are many times this has been mentioned in this forum.  The only time you should only update part of the screen is in onPartialUpdate.

  • thank you for your answer. I will try to make attempt to manage it somehow.

  • The way to manage it is to redraw everything each time onUpdate() is called.  With a watch face, most times that's once a minute and there are things on a real device like notifications and toasts where your app doesn't know they happened or what part of the screen was impacted.