Code example for JsResult

Methods: cancel

0
        dlg.setOnKeyListener(new DialogInterface.OnKeyListener() {
            //DO NOTHING 
            public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
                if(keyCode == KeyEvent.KEYCODE_BACK)
                { 
                    result.cancel();
                    return false; 
                } 
                else 
                    return true; 
                } 
            }); 
        dlg.create();
        dlg.show();
        return true; 
    } 
 
    /** 
     * Tell the client to display a prompt dialog to the user. 
     * If the client returns true, WebView will assume that the client will 
     * handle the prompt dialog and call the appropriate JsPromptResult method.