This topic describes how you can implement an application exit: through user interaction, or internally based on the application logic.
If you do not want the application to terminate, but only hide in the background, implement Multitasking.
Implementing the Exit
There are 2 ways to terminate a TV application:
Through user interaction, when the user long-presses the remote control "Return/Exit" key.
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
getCurrentApplication().exit()method of the Application API terminates the application.
Call this method to implement the "Yes" button on an exit confirmation popup.
Return Key Policy
The Samsung Apps TV policy defines requirements for the implementation of the "Return/Exit" key click:
- From a detail page within an application, clicking the "Return/Exit" key must display the previous page.
- From the home page of an application, clicking the "Return/Exit" key must display an exit confirmation popup.
The application is only terminated if the user clicks "Yes" in the popup.
You must make the application exit confirmation popup independently, using an HTML element.