hi,
Encounter issues invoking window.tizen.application.getCurrentApplication().exit(); or tizen.application.getCurrentApplication().exit() in RD-PQ test device with Tizen 2.2
The exit() method is not fired, the line before console.log("[DEBUG] Page1 EXIT()!"); is triggered in debug mode and no errors displayed.
Do i need to add anything in config.xml ? features? privileges ??? Need help to figure out what's going on....
Code
-------------------------------------------------------------------------------------------------------------------------------------------------------
function init()
{
console.log("document init!");
document.addEventListener('tizenhwkey', function(e) { // assign hardware buttons click event handler
console.log("[DEBUG] Back key hit!");
if(e.keyName == 'back') { // if back button is clicked
if ($.mobile.activePage.attr('id') === 'page1') {
//if ( location.hash === 'page1') { // if the main page is active
console.log("[DEBUG] Page1 EXIT()!");
window.tizen.application.getCurrentApplication().exit(); // close the application
} else { // if not main page is active
console.log("[DEBUG] mobile.back()! ("+location.hash+")("+$.mobile.activePage.attr('id')+")");
$.mobile.back(); // go to the previous page
}
}
});
};
$(document).bind('pageinit', init); // assign the init function call to the page initialization
-------------------------------------------------------------------------------------------------------------------------------------------------------
My setup
OS : Mac OSX 10.7.5
TIzen SDK : 2.2
Device Image : 2.2
Thank you...
Br,
Peter