Close application with onclick
Hello,
I got an AlertDialog, when a users clicks on 'Ok'. My application should shutdown. Does anybody knows how to do this?
Greetings,
Jacob
4 Answers
-
There is a property for the createWindow method on android called "exitOnClose". Set it to true and then close the window.
details: http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.Window-object
Otherwise I don't believe there is a way to programatically 'close' the app – other than forcing a crash.
-
I would also like to use this (on both iPhone and Android). Did anyone found a solution already?
-
That's not typical Android app behavior, but try calling
close()
on the initial window. -
var activity = Titanium.Android.currentActivity;
activity.finish();