Skip to content

Crashed Hint Texts When Same Alert Is Reused #18

@simongiesen

Description

@simongiesen

I build my ArrayList for the hints texts every time new. Also, the alert object itself is created new every time.

Showing up the alert for the first time, it works. Next time, it doesn't. Can you help?

ArrayList<String> lineHintEN = new ArrayList<>();
                lineHintEN.add("Prename");
                lineHintEN.add("Surname");
                lineHintEN.add("Email");
                lineHintEN.add("Birthday");

CustomAlertDialogue.Builder alert = new CustomAlertDialogue.Builder(SampleActivity.this)
                            .setStyle(CustomAlertDialogue.Style.INPUT)
                            .setTitle(title)
                            .setMessage(message)
                            .setPositiveText(positiveText)
                            .setPositiveColor(R.color.positive)
                            .setPositiveTypeface(Typeface.DEFAULT_BOLD)
                            .setOnInputClicked(new CustomAlertDialogue.OnInputClicked() {
                                @Override
                                public void OnClick(View view, Dialog dialog, ArrayList<String> inputList) {
                                    for (String input : inputList) {
                                        Log.i("Input", input);
                                    }
                                    dialog.dismiss();
                                }
                            })
                            .setNegativeText(negativeText)
                            .setNegativeColor(R.color.negative)
                            .setOnNegativeClicked(new CustomAlertDialogue.OnNegativeClicked() {
                                @Override
                                public void OnClick(View view, Dialog dialog) {
                                    dialog.dismiss();
                                }
                            })
                            .setLineInputHint(lineHintEN)
                            .setLineInputText(lineText)
                            .setBoxInputHint(boxHint)
                            .setDecorView(getWindow().getDecorView())
                            .build();
                    alert.show();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions