简体   繁体   English

如何在退出当前 Tizen 应用程序时启动 Pervious Tizen 应用程序?

[英]How to Launch Pervious Tizen app on exit of current Tizen app?

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 .我已经创建了一个 Tizen 应用程序,当我从Samsung tv上的Samsung app menu启动我的Tizen app Samsung app menu时,在启动后,当我按下return key时,我return keyBroadCast menu而不是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我想当我从三星应用程序菜单启动我的应用程序时,如果我退出我的应用程序启动后它应该打开三星菜单而不是广播菜单

You can launch Samsung app menu manually by:您可以通过以下方式手动启动Samsung app menu

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 :您也可以尝试使用以下代码,但我不确定Samsung app menu是您的Tizen app的调用者:

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

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

tizen.application.launch(callerAppId, onsuccess);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM