I am fairly new to programming, so probably Monkey C is a long shot for me, but I wanted to give it a try. After a few hours spend looking through samples and forum, I have decided that it would be easier just to ask.
The code that I am posting here is going to be just a base for me to understand how to implement various activity infos into the screen. Eventually I would like to end up with 8 different values displayed on one data field.
using Toybox.WatchUi as Ui;
using Toybox.Graphics as Gfx;
using Toybox.System as Sys;
using Toybox.Activity as Act;
class UUView extends Ui.DataField
{
var bla1;
var info;
function initialize()
{
}
function onUpdate(dc)
{
info = Act.getActivityInfo();
if( info.elapsedTime != null )
{
bla1 = info.elapsedTime;
}
return bla1;
dc.clear();
dc.setColor( Gfx.COLOR_WHITE, Gfx.COLOR_RED );
dc.drawText( 11, 11, Gfx.FONT_SMALL, bla1, Gfx.TEXT_JUSTIFY_LEFT );
}
}
Eclipse compiles the code just fine, but after running it on simulator, I get no red background color, or anything else displayed, just white screen on watch in simulator.
Please help me figure that out. I bet it is simple and I am dumb :)