how do i update a label in createLabel regularly when the user has internet connection?
i plan to update the Label text regularly when the user have internet connection, how can i do that in appcelerator?
i dont want to use webviews because i found a caution in the api documentation that the webview is much slower than the native api in appcelerator.
thanks
1 Answer
-
Accepted Answer
fire an event when the internet status changes. In that event update the label text
Ti.App.fireEvent('inet_status', {statusStr:'change in status!'});
Listen for the event with the UILabel
inetStatus.addEventListener("inet_status", function(data) { inetStatus.text = data.statusStr; });