Hi
In era I have some error, but I don't understand the issue.
using Toybox.Application ;
import Toybox.WatchUi;
in this code I have a bug in ERA
Error Name: Unexpected Type Error
Occurrences: 8
First Occurrence: 2022-02-13
Last Occurrence: 2022-02-14
Devices:
Venuâ„¢ 2S: 5.38
Venuâ„¢: 6.50
Upcoming Wearable: 5.38
Venuâ„¢ 2 Plus: 7.40
Venuâ„¢ 2 Plus: 6.06
App Versions: 2.2.0
Languages: deu, eng, fre, tha
Backtrace:
GenView.LoadSettingsCommun:3487
GenView.ReLoadSettings:3855
GenApp.onSettingsChanged:120
Occurrences: 8
First Occurrence: 2022-02-13
Last Occurrence: 2022-02-14
Devices:
Venuâ„¢ 2S: 5.38
Venuâ„¢: 6.50
Upcoming Wearable: 5.38
Venuâ„¢ 2 Plus: 7.40
Venuâ„¢ 2 Plus: 6.06
App Versions: 2.2.0
Languages: deu, eng, fre, tha
Backtrace:
GenView.LoadSettingsCommun:3487
GenView.ReLoadSettings:3855
GenApp.onSettingsChanged:120
in a function after an onchangesettings I have some error.
function LoadSettingsCommun(){
bla bla....
if (ReduceIcon) { ICON=WatchUi.loadResource(Rez.Fonts.ICONMINI); }
else { ICON=WatchUi.loadResource(Rez.Fonts.ICON); }
iconsize= $.dc2.getTextWidthInPixels("c", ICON); here the issue.
}
All fonts are defined correctly because this function is called on initialized function and is OK.
In the documentation you can use Application.loadResource or WatchUi.loadResource
What are the differences
I suppose ICON variable isn't correctly loaded, but why in the first it's good and not after a reload 'in some case of course)
Didier