Cannot capture "Back Button" event in Cloud Connected Mobile

General discussion on Zend Studio
Post Reply
jinfeei
Posts: 4
Joined: Thu Oct 20, 2011 9:58 am

Cannot capture "Back Button" event in Cloud Connected Mobile

Post by jinfeei » Wed Oct 09, 2013 10:50 am

I am trying to do a simple project using Cloud Connected Mobile. But I'm having problem with capturing the Back Button event in generated Android code.

Without a way to properly capture and handling this event, most applications on Android would be rendered "unfriendly". For example, try using the Back button in the generated simple app - the behavior is just NOT acceptable.

Or is it something I'm doing wrong?

Here is my code in my.js - I can see onDeviceReady alert, but onBackKeyDown is never triggered...

document.addEventListener("deviceready", onDeviceReady, false);

function onDeviceReady(){
document.addEventListener("backbutton", onBackKeyDown, false);
alert('onDeviceReady()');
}

function onBackKeyDown() {
alert('Back Button');
}

Thanks...

Post Reply