开发者

ArrayAdapter.getPosition(item) Returns What?

开发者 https://www.devze.com 2023-03-20 13:12 出处:网络
I see the开发者_JS百科 documentation says this method returns the position of the given item, but what would it return if no such item exists in the ArrayAdapter?After looking through the source code

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


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

精彩评论

暂无评论...
验证码 换一张
取 消