Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

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

— asked November 12th 2010 by Raymond Ho
  • android
  • iphone
0 Comments

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;
    });
    
    — answered November 12th 2010 by Aaron Saunders
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.