Torben
Torben

Reputation: 549

Android Phonegap App - menubutton event sometimes does not fire

Im using Telerik AppBuilder with Cordova version 3.5 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 firing only on double tab the menu key on Android v4.4.4 running on my Motorola G.

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

Upvotes: 3

Views: 314

Answers (0)

Related Questions