Not capturing focus or focused events
Hi
I have the following codes:
win.addEventListener('focused', function(e)
{
Refresh();
});
For some reason(s), I am not capturing the event when I change tabs??
2 Answers
-
Accepted Answer
Hey Peter,
"focus" should work okay, I use it quite a bit in a couple apps I'm working on. Maybe try logging something to Developer when you enter the function just in case it's a problem with your Refresh function.
Ti.UI.currentWindow.addEventListener('focus', function() { Ti.API.info('in focus event listener'); });
Oh, and also make sure you have the latest SDK. There actually was a problem with one of them where the focus event would not fire. I forget which it was now, but I can confirm it works in 1.1.2
-
It works now, thanks!