public void showPrompt()

in framework/src/org/apache/cordova/CordovaDialogsHelper.java [124:150]


    public void showPrompt(String message, String defaultValue, final Result result) {
        // Returning false would also show a dialog, but the default one shows the origin (ugly).
        AlertDialog.Builder dlg = new AlertDialog.Builder(context);
        dlg.setMessage(message);
        final EditText input = new EditText(context);
        if (defaultValue != null) {
            input.setText(defaultValue);
        }
        dlg.setView(input);
        dlg.setCancelable(false);
        dlg.setPositiveButton(android.R.string.ok,
                new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        String userText = input.getText().toString();
                        result.gotResult(true, userText);
                    }
                });
        dlg.setNegativeButton(android.R.string.cancel,
                new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        result.gotResult(false, null);
                    }
                });
        lastHandledDialog = dlg.show();
    }