Skip to content

Instantly share code, notes, and snippets.

@pegli
Last active September 11, 2019 21:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pegli/2016a1d2161a558ba826 to your computer and use it in GitHub Desktop.
Save pegli/2016a1d2161a558ba826 to your computer and use it in GitHub Desktop.
Titanium: resume event handling on iOS and Android
var win = Ti.UI.createWindow({
backgroundColor: "white",
});
var label = Ti.UI.createLabel({
text: "init"
});
win.add(label);
win.addEventListener("open", function() {
if (this.activity) {
this.activity.onResume = function() {
label.text = "Android resume " + (new Date());
};
}
else {
Ti.App.addEventListener("resumed", function() {
label.text = "iOS resumed " + (new Date());
});
}
});
win.open();
@Abdelalim-dev
Copy link

Thanks, pal. This helped me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment