Skip to content

fix: AutoCompleteAdapter crash with a single-item list - #10

Merged
OmarShehe merged 1 commit into
masterfrom
fix/autocomplete-single-item
Oct 4, 2026
Merged

OmarShehe merged 1 commit into
masterfrom
fix/autocomplete-single-item

Conversation

@OmarShehe

Copy link
Copy Markdown
Owner

Fixes #9.

AutoCompleteAdapter passed the caller's list straight to ArrayAdapter. An immutable list such as listOf(x) made clear() throw UnsupportedOperationException while filtering. It now passes a mutable copy.

Tested: new instrumented test (single-item and multi-item lists) on a Pixel 9, API 17 image. It fails on the old code and passes with the fix.

ArrayAdapter wrapped the caller's list, so an immutable list such as
listOf(x) made clear() throw UnsupportedOperationException while filtering.
Pass a mutable copy instead, and add an instrumented regression test.
@OmarShehe
OmarShehe merged commit ebe7675 into master Oct 4, 2026
2 checks passed
@OmarShehe
OmarShehe deleted the fix/autocomplete-single-item branch October 4, 2026 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error when only 1 data in array

1 participant