tamir7 / Contacts

Android Contacts API
287 stars 74 forks source link

Query.include() without Field.ContactId will returns only last Contact #42

Open roenano opened 6 years ago

roenano commented 6 years ago

In the latest version Contact.InternalField.ContactId was moved to Contact.Field.ContactId causing Query.buildProjection() to exclude this field if not added when calling Query.include().

When iterating through the cursor in Query.find(ids), CursorHelper.getContactId() will always return null causing the contactsMap to be overriden with every new Contact.

IMO, adding projection.add(Contact.Field.ContactId.getColumn()); to Query.buildProjection() should do the trick