1

I have created a Tizen application and when i launch my Tizen app from the Samsung app menu on Samsung tv and after launching when I press return key i get back to the BroadCast menu instead if Samsung app menu. i am using below code to exit the app after confirmation pop up

App.exit = function() {
    if (confirm("Do you want to exit?")) {

        var isRemember = localStorage.getItem('remember');
        console.log("app-rem : " + isRemember);
        if (isRemember == 'false') {
            console.log("cleared");
            localStorage.clear();
            sessionStorage.clear();
        }
        tizen.application.getCurrentApplication().exit();

    }
};

i want when I launch my application from Samsung app menu and after launching if I exit my app it should open samsung menu instead of broadcasting menu

Nitin tiwari
  • 664
  • 1
  • 8
  • 23

1 Answers1

2

You can launch Samsung app menu manually by:

App.exit = function() {
    if (confirm("Do you want to exit?")) {

        var isRemember = localStorage.getItem('remember');
        console.log("app-rem : " + isRemember);
        if (isRemember == 'false') {
            console.log("cleared");
            localStorage.clear();
            sessionStorage.clear();
        }

        function onsuccess() {
          tizen.application.getCurrentApplication().exit();
        }

        tizen.application.launch("com.samsung.tv.store", onsuccess);

    }
};

Also you can try to use below code, but I am not sure that Samsung app menu is the caller of your Tizen app:

var currentApp = tizen.application.getCurrentApplication();
var callerAppId = currentApp.getRequestedAppControl().callerAppId;

function onsuccess() {
    tizen.application.getCurrentApplication().exit();
}

tizen.application.launch(callerAppId, onsuccess);
djus22
  • 21
  • 2