I am using string resources (as someone on these forums recommended them for memory efficiency) and I see some weird behavior. I have my string resources like this:
<strings>
<string id="AppName">PacerField</string>
<string id="label">Lap</string>
<string id="label2">Avg Pace T: </string>
</strings>
In my DataField I want to update the label for average pace to include the target pace (hence the T: ) so in onUpdate() I do this:
label2Field.setText(Rez.Strings.label2+expectedAvgPaceString);
Let's say expectedAvgPaceString is something like "7:35", calculated in compute(), I get "9457:35" for my label2!
If I leave out the +expectedAvgPaceString I get "Avg Pace T:".
To start understanding what was going on I tried a few other strings including "", I always get 945 instead of my string.
When I tried using System.println() I got the following:
In the code:
System.println(Rez.Strings.label2);
System.println(Rez.Strings.label2+"");
System.println(Rez.Strings.label2.toString());
Console output:
945
945
945
Anyone have an explanation? Also, I can make all of this work by using explicit strings in the code, but it uses more memory and is less portable if I ever decided to make other language versions.
Thanks,
Gerald