ShowTable of Contents
Resume app
When the user changed to another app and then opens your app again, the resume event is fired:
Titanium.App.addEventListener('resume', function (e) {
});
Orientation Change
Ti.Gesture.addEventListener('orientationchange',function(e)
{
/* orientation:
e.orientation == 1 (portrait)
e.orientation == 2 (upside down)
e.orientation == 3 (landscape, home button right)
e.orientation == 4 (landscape, home button left)
*/
if (e.orientation == 1 || e.orientation == 2) {
// ...
} else {
// ...
}
});
Custom Events
Ti.App.fireEvent("myevent", {param1:"value1",param2:"value"});
Ti.App.addEventListener("myevent", function(e) {
var v1 = e.param1;
var v2 = e.param2;
})