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?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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