I need detect when my app moved to background by home pressed.
I try the next code:
document.addEventListener("pause", function(){
console.log("pause");
}, false);
$("#main-page").focusout(function (){
console.log("received focus Out Event") ;
});
$("#main-page").on("pagehide", function() {
console.log("main-pagehide");
});
$("#main-page").on("pageremove", function() {
console.log("main-pageremove");
});
$("#main-page").on("pagebeforehide", function() {
console.log("main-pagebeforehide");
});
but when I pressed home nothing happens.