Refresh data on window resume

You must Login before you can answer or comment on any questions.

I would like to refresh de data on my Window when the user returns to that Window (For example, if a I have a list with friends and then the user adds a new friends, then the app returns to the friend list, I would like to refresh the friends list). I used to do that in a "onResume" in Android, but I don't how can i do this in Titanium (didn't find anything useful in google or here)

1 Answer

you can use focus event of window .

Refer link

— answered 1 year ago by Moiz Chhatriwala
answer permalink
3 Comments
  • Oh boy, Thank you!

    — commented 1 year ago by Nahuel Gabioud Fernandez

  • Welcome :))

    — commented 1 year ago by Moiz Chhatriwala

  • Sorry, I was unable to test it, but that didn't work for me. When I first start the window, it does what I want, but when I press the backbutton (android) in a window and return to that window, it doesn't do what I want (I displayed and alert, just to test it), the code I dis is the following:

    main.addEventListener('focus', function(e){
            alert('Hi');
        });

    — commented 1 year ago by Nahuel Gabioud Fernandez

Your Answer

Think you can help? Login to answer this question!