I do not know if it will solve your issue. But according to your code, it is possible that you try to call some Cordova methods whereas Cordova has not been loaded yet.
initialize: function() {
document.addEventListener('deviceready', this.onDeviceReady, false);
},
onDeviceReady: function() {
console.log("onDeviceReady called");
document.addEventListener('backbutton', this.onBackButton, true);
document.addEventListener('pause', this.onPauseButton, true);
},
onPauseButton: function() {
console.log("onPauseButton called");
},
onBackButton: function() {
console.log("onBackButton called");
console.log("current view: "+GUIManager.currentView);
if(GUIManager.VIEW_LOCALE == GUIManager.currentView ){
GUIManager.showMatchListScreen();
} else if(GUIManager.VIEW_MATCHLIST == GUIManager.currentView){
navigator.app.exitApp();
}
}
Please see phonegap doc link about events: http://docs.phonegap.com/en/2.7.0/cordova_events_events.md.html#Events