ArrayAdapter.getPosition(item) Returns What?

前端 未结 1 1546
时光说笑
时光说笑 2021-02-05 02:14

I see the documentation says this method returns the position of the given item, but what would it return if no such item exists in the ArrayAdapter?

相关标签:
1条回答
  • 2021-02-05 03:00

    After looking through the source code I've found that the ArrayAdapter uses List.indexOf(Object) to find the object and this method returns -1 when it doesn't exist.

    GrepCode is awesome for finding stuff when the documentation is bad, I use it at least once a day :)

    Source: GrepCode

    0 讨论(0)
提交回复
热议问题