CustomAlertViewDialogue icon indicating copy to clipboard operation
CustomAlertViewDialogue copied to clipboard

Crashed Hint Texts When Same Alert Is Reused

Open simongiesen opened this issue 1 year ago • 0 comments

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();

simongiesen avatar Aug 23 '23 08:08 simongiesen