Hey guys,
I can't find out what's wrong with my watch face...
Everything works fine, but when I change my settings, the view doesn't refresh by itself, I must run the project again to see changes...
In previous versions of Monkey C, I was used to use this code in app.mc :
function onSettingsChanged(){
Ui.requestUpdate();
}
The only difference between my previous watch face and the new one is that in the previous watch face, I used the layout.xml. I don't use this in this one (by the way, is this a good method or should I use layout ?)
But it doesn't work anymore...
I desperatly tried to find some clues on the forum but didn't get anything...
Can you help me ? :rolleyes:
EDIT :
Actually, I just discovered something... The watch face actually DOES refresh but since I load all my settings into onLayout function, they are not refreshed after settings changes...
So I coded a workaround
First : I modified the app.mc to transform the watch face view as a var so I can call watch face functions through the app.mc
//! Return the initial view of your application here
var view = null;
function getInitialView() {
view = new NewGenreView();
return [view];
}
I created a function loadSettings() to load all settings, I call it in onLayout and in the app.mc
function onSettingsChanged(){
view.loadSettings();
Ui.requestUpdate();
}
Problem solved !
Thanks me :p