Languages

Menu
Sites
Language
How to navigate to home screen

My app needs to run in the background, so when user press back button on the home page, I want it to not to exit immediately but instead  let user choose whether to go to home screen or exit. So how do I navigate to home screen in js code?

Responses

2 Replies
Lakshmi Grandhi

Hi

For going back to home screen with exit use hide function, it will take to home screen

 

$(window).on('tizenhwkey', function (e) {
        if (e.originalEvent.keyName === "back") {
            if ($.mobile.activePage.attr('id') === 'main') {
                if( exit == "yes")
                tizen.application.getCurrentApplication().exit();
                else
                    tizen.application.getCurrentApplication().hide();
            } else {
                history.back();
            }
        }
    });

 

 

Imgen Tata

Thanks for the quick and decisive answer. That's exactly what I need. Thanks again.