This topic describes how you can implement an application exit: through user interaction, or internally based on the application logic.
Application API
When the user exits an Web application, JavaScript execution is paused, and the current application state is not stored. When the application is launched again, the application state is reset.
Note If you do not want the application to terminate, but only hide in the background, implement Multitasking.
If you do not want the application to terminate, but only hide in the background, implement Multitasking.
There are 2 ways to terminate an application:
Through user interaction, when the user long-presses the remote control "Return/Exit" key.
Figure 1. "Return/Exit" key
Important Long-pressing the "Return/Exit" key forces the application to terminate. Do not register the "Return/Exit" key long-press.
Long-pressing the "Return/Exit" key forces the application to terminate. Do not register the "Return/Exit" key long-press.
Based on the application logic, by calling the exit() method
exit()
The getCurrentApplication().exit() method of the Application API terminates the application.
getCurrentApplication().exit()
tizen.application.getCurrentApplication().exit();
Call this method to implement the "Yes" button on an exit confirmation popup.
The Samsung Apps TV policy defines requirements for the implementation of the "Return/Exit" key click:
Figure 2. "Return/Exit" key click process
Note You must make the application exit confirmation popup independently, using an HTML element.
You must make the application exit confirmation popup independently, using an HTML element.