[AutoCompleteTextView] Pop up menu calls adapter.getView()
, not adapter.getDropDownView()
#4374
Labels
adapter.getView()
, not adapter.getDropDownView()
#4374
Description:
When an adapter is set on an
AutoCompleteTextView
, the adapter'sgetView()
method is called to get the view to show in the dropdown / popup menu. From the adapter documentation (e.g., onArrayAdapter
) I had expectedgetDropViewView()
to be called.Expected behavior:
getDropDownView()
to be called. It is documented as:where as
getView()
is documented as:Since I'm using
AutoCompleteTextView
in an exposed dropdown menu (https://github.com/material-components/material-components-android/blob/master/docs/components/Menu.md#exposed-dropdown-menu-example) I expected the method with dropdown in the name to be called.It's probably too late to change the code (outside of a breaking change release), but a very clear note in the documentation everywhere it demonstrates setting an adapter that
getDropDownView
is ignored would be helpful.Source code:
Instrumenting
getDropDownView
andgetView
with logging calls quickly shows that onlygetView
is called.Android API version: 31
Material Library version: 1.12.0
Device: Emulator
The text was updated successfully, but these errors were encountered: