0

In java, I can call System.exit if i want to shut up shop and go home.

In titanium appcelerator, what is the command to do that? I don't want to have to keep track of all the open windows, I just want the entire app to give up and let the user manually restart.

I've tried closing the "root" window, or setting "exitonclose" to true, but that will only work on android, not ios.

Any ideas?

bharal
  • 15,461
  • 36
  • 117
  • 195
  • For iOS it is not possible to close /quit an app. [Learn more here](https://stackoverflow.com/questions/22616698/quit-application-in-titanium-ios) – Sake de Vries Jul 24 '17 at 13:13

1 Answers1

1

In android, you can use following code

var appActivity = Ti.Android.currentActivity;
appActivity.finish();

The Ti.Android.currentActivity property provides a reference to the context's current Activity.This code will finish the current activity.

Reference

Titanium Android- Application close\exit

Melvin Joseph Mani
  • 1,494
  • 15
  • 25