I want to retrive index of specific element of my list :
ArrayList<Field> list = new ArrayList<Field>();
list.addAll(profile.getFieldsList());
Object privacyName = "privacy";
int i = list.indexOf(privacyName);
boolean doesContain = list.contains(privacyName);
There is a field containing "privacy" in the list but i is always -1 and doesContain is always false. Why this search doesn't work ?
Field, which cannot have the value"privacy". Do you have some property ofField, for which you are having that value?