Skip to content

fix bug !!!To avoid calling the return key, you can mask a line of code in the OnCancel method of the multispinnersearch class。 #96

@piaomiao8179

Description

@piaomiao8179

@pratikbutani To avoid calling the return key, you can mask a line of code in the OnCancel method of the multispinnersearch class。
`
@OverRide
public void onCancel(DialogInterface dialog) {
// refresh text on spinner
// super.performClick()
StringBuilder spinnerBuffer = new StringBuilder();

    ArrayList<KeyPairBoolData> selectedData = new ArrayList<>();
    for (int i = 0; i < items.size(); i++) {
        KeyPairBoolData currentData = items.get(i);
        if (currentData.isSelected()) {
            selectedData.add(currentData);
            spinnerBuffer.append(currentData.getName());
            spinnerBuffer.append(", ");
        }
    }

    String spinnerText = spinnerBuffer.toString();
    if (spinnerText.length() > 2)
        spinnerText = spinnerText.substring(0, spinnerText.length() - 2);
    else
        spinnerText = this.getHintText();

//
ArrayAdapter adapterSpinner = new ArrayAdapter<>(getContext(), R.layout.simple_spinner, new String[]{spinnerText});
setAdapter(adapterSpinner);

    if (adapter != null)
        adapter.notifyDataSetChanged();

    listener.onItemsSelected(selectedData);
}

`

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions