I am new to developing a sencha touch application. I am converting this application for android. I am trying to use the back button of the android device in my app, but I could not get the proper result. Below are the relevant parts of the app.js file.
launch:function(){
Ext.fly('appLoadingIndicator').destroy();
Ext.Viewport.add(Ext.create('Myapp.view.Main'));
document.addEventListener("backbutton", function(e) {
e.preventDefault();
alert('the back key is pressed');
}, false);
},
The above code is just for checking if the callback for pressing the back button of the android device is called or not. But unfortunately I can't see the alert message.
Is there any kind of improvement I can apply to the above code?