Code example for JsPromptResult

Methods: confirm

0
    @Override 
    public boolean onJsPrompt(WebView view, String url, String message, String defaultValue, JsPromptResult result) {
        TransitFuture<String> future = new TransitFuture<String>();
 
        if (transitAdapter.onJSCall(message, defaultValue, future)) {
            result.confirm(future.block());
            return true; 
        } else { 
            return super.onJsPrompt(view, url, message, defaultValue, result);
        } 
    } 
 
    @Override 
    public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
        switch (consoleMessage.messageLevel()) {
        case ERROR:
            Log.e(TAG, consoleMessage.message());
            break; 
        case WARNING:
            Log.w(TAG, consoleMessage.message());