Code example for JsPromptResult

Methods: confirm

0
        } 
 
        // Polling for JavaScript messages 
        else if (reqOk && defaultValue != null && defaultValue.equals("gap_poll:")) {
            String r = ctx.getCallbackServer().getJavascript();
            result.confirm(r);
        } 
 
        // Calling into CallbackServer 
        else if (reqOk && defaultValue != null && defaultValue.equals("gap_callbackServer:")) {
            String r = "";
            if (message.equals("usePolling")) {
                r = ""+ ctx.getCallbackServer().usePolling();
            } 
            else if (message.equals("restartServer")) {
                ctx.getCallbackServer().restartServer();
            } 
            else if (message.equals("getPort")) {
                r = Integer.toString(ctx.getCallbackServer().getPort());
            } 
            else if (message.equals("getToken")) {
                r = ctx.getCallbackServer().getToken();
            } 
            result.confirm(r);
        } 
 
        // Cordova JS has initialized, so show webview 
        // (This solves white flash seen when rendering HTML) 
        else if (reqOk && defaultValue != null && defaultValue.equals("gap_init:")) {
            if (ctx.getSplashscreen() != 0) {
                ctx.getRoot().setBackgroundResource(0);
            } 
            ctx.getAppView().setVisibility(View.VISIBLE);
            ctx.spinnerStop();
            result.confirm("OK");
        } 
 
        // Show dialog 
        else { 
            final JsPromptResult res = result;