Titanium Community Questions & Answer Archive

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

Not capturing focus or focused events


I have the following codes:

win.addEventListener('focused', function(e)



For some reason(s), I am not capturing the event when I change tabs??

— asked March 27th 2010 by Peter Lum
  • capturing
  • change
  • event
  • focus
  • focused
  • 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

    — answered March 27th 2010 by Dan Giulvezan
  • It works now, thanks!

    — answered March 27th 2010 by Peter Lum
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.