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:
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