Simulator Multi-Field Bug

I thought this was fixed. I'm running the latest Eclipse/Plugin and the latest SDK. When I render my data field in a multi-field view, only the last instance displays properly. Not a big deal.... since I only really need to see it in one field. But probably an easy fix in 3.8.

  • Make sure there's a bug report, and if there's on old one, update it with the new info (SDK version, etc)

  • It doesn't look like you're clearing the draw context before drawing your text in onUpdate(). If you don't clear the draw area, then whatever was there previously will remain and you'll just draw on top of it.

    var bgColor = DataField.getBackgroundColor(); // assuming this is in a data field app
    var fgColor = ~bgColor & 0xFFFFFF;
    
    dc.setColor(bgColor, bgColor);
    dc.clear();
    
    dc.setColor(fgColor, Graphics.COLOR_TRANSPARENT);
    // draw text and stuff

    Some devices (and our simulator at some points in time) automatically cleared the dc before calling into user code so you didn't absolutely have to do it and it would seem to be correct. But if you don't clear it, you can get results like this.

  • Note that the above response is based completely on the appearance of the problem. I haven't yet looked into the code or any existing bug reports to see if we've done something wrong on our end.

  • Thx! I’ll verify and/or update my code and report back