Android Phonegap App - menubutton event sometimes doesn't fire

Im using Telerik AppBuilder with Cordova 3.5 version and the following code to provide physically back and menu buttons on android devices:

var app;

function onLoad()
{
    document.addEventListener("deviceready", onDeviceReady, false);
}

function onDeviceReady()
{    
    app = new App();

    app.run();

    document.addEventListener("backbutton", onBackBtn, false);
    document.addEventListener("menubutton", onMenuBtn, false);                    
}            

function onBackBtn()
{
    app.goToPrevView();
}

function onMenuBtn()
{
    app.menu.toggle();
}  

      

But sometimes the menubutton event is only triggered on a double tab by a menu key on Android v4.4.4 running on my Motorola G.

Maybe it has to do with the virtual keys on this device?

+3
android cordova icenium


source to share


No one has answered this question yet

Check out similar questions:

five
"Backbutton" event does not fire
3
Cordova Application Close Event
2
Cordova - menubutton event not firing
1
Deviceready event not fired in a hybrid Angular app
1
phonegap / cordova onDeviceReady () doesn't start android 4.1.2
1
Tries to access a local file in the Meteor application, but cannot start document.addEventListener ("deviceready", onDeviceReady, false);
1
Cordless android 4.x flip event not fired when resources are not local (using http)
0
SQLite database not created in Phonegap app (Android)
0
I can't seem to run cordova's inAppBrowser function to open urls.
0
App Exit does NOT work when clicking the Back button in Android app (Phonegap & AngularJS)



All Articles
Loading...
X
Show
Funny
Dev
Pics