Titanium Community Questions & Answer Archive

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


What events are there. I want to execute code before the application is closed.

I know about the button events but does the app object have the same events? I want to save some data right after the user presses the close button on the iphone.

EDIT: for some reason i can't vote other's posts up.

— asked May 26th 2010 by Gyozo Kudor
  • addeventlistener
  • ipone
  • mobile
  • 5 years later, still no list of possible events anywhere in the docs……..

    — commented November 30th 2014 by David D
  • I wish I could edit/delete, I found them eventually. It was just too obvious ^^

    — commented December 9th 2014 by David D

2 Answers

  • If you go to the address below you'll notice that there are three sets of data: Methods, Properties, Events. The Events section is all the different events you can have for that particular object, in this instance a Button.


    I'm not sure there is any way to execute code before the app closes in Titanium but it would be a good feature to have seeing as this is possible in other apps. Can anyone confirm?

    — answered May 26th 2010 by Ryan Gartin
  • I have noticed there is a section for events in the docs, but like Gyozo I cannot find events for the App. The kitchen sync demo has, for example, registered events for

    Titanium.App.addEventListener('show_indicator', …);
    Titanium.App.addEventListener('hide_indicator', …);
    Titanium.App.addEventListener('close', …);

    I have seen in other posts that there is only pause, resume and close events for Titanium.App. However, the docs appear to not show any events for Titanium.App.

    Does that meant they were removed, unsupported or just missing from the docs?

    BTW the close event does fire, but I do not see the show / hide indicator events in the kitchen sink demo firing.

    I did find that the show_indicator appears to be a custom event created for use in the kitchen sink app. The close and other events for App though I still dont see in the docs.

    — answered June 15th 2010 by Fred Arters
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.