Titanium.App.addEventListener
What events are there. I want to execute code before the application is closed.
EDIT:
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.
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.
https://developer.appcelerator.com/apidoc/mobile/1.3/Titanium.UI.Button-object.html
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?
-
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.