ConfirmDialog plugin and returning a boolean value

Greetings, I have tried to use the plugin “ConfirmDialog” to return a boolean depending on what the user needs, this is what I have so far:

public static boolean showQuestion(String message)
    final boolean[] confirmed = {false};
        "¿Are your sure?:",
        new ConfirmDialog.Listener() {
            public void onClose(ConfirmDialog dialog) {
                if (dialog.isConfirmed()) {
                    // Confirmed to continue
                } else {
                    // User did not confirm

    return confirmed[0]

My problem is that it always returns the false value.

What am I doing wrong?.

Thanks in advance for the help. does not block until a response has been received, so your method will always return the initial value of confirmed[0] , which is false. The programming model does not allow blocking for a response, you will need to add a listener in the caller instead and continue when the listener is triggered.