setInterval or Another Alternative?
After setInterval crashed my app a few times, I went to the forums and noticed that there is currently a bug with this function. Is there any ETA on a fix, or some other alternative I can use. Basically, I am just trying to swap the BackgroundImage of a View every second or so.
1 Answer
-
setInterval does work, I guess I was just calling it incorrectly. For any who are interested, here is an example of how it works:
var green = false; function changeLEDColor () { if (green) { ledView.backgroundImage = 'images/greenLED.png'; green = false; } else { ledView.backgroundImage = 'images/redLED.png'; green = true; } } setInterval(changeLEDColor,1000);