Cordova backbutton Event Never Firing

前端 未结 3 1543
闹比i
闹比i 2021-01-24 15:08

I am overriding my device back button per the documentation that I attach event listener to backbutton with argument of false after the devicerea

3条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-24 15:34

    Try using the normal way of using cordova events.

    // device APIs are available
    //
    function onDeviceReady() {
        // Register the event listener
        document.addEventListener("backbutton", onBackKeyDown, false);
    }
    
    // Handle the back button
    //
    function onBackKeyDown() {
        //Add your back button implementation.
    }
    

    official documentation here

    Modified code

    
    
    
    
    
    
    Tigo SMART Installation
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

    Few reference links here and here

提交回复
热议问题