Fix issue in contact helper, where contact wasn't found if he didn't had a picture
This commit is contained in:
parent
1410765d5d
commit
fb40893c3f
1 changed files with 7 additions and 5 deletions
|
@ -228,17 +228,19 @@ public final class ContactHelper {
|
|||
Uri contactUri = ContentUris.withAppendedId(android.provider.ContactsContract.Contacts.CONTENT_URI, id);
|
||||
Uri photoUri = Uri.withAppendedPath(contactUri, android.provider.ContactsContract.Contacts.Photo.CONTENT_DIRECTORY);
|
||||
if (photoUri == null) {
|
||||
continue;
|
||||
}
|
||||
// continue;
|
||||
// }
|
||||
String[] photoProj = {android.provider.ContactsContract.CommonDataKinds.Photo.PHOTO};
|
||||
Cursor cursor = resolver.query(photoUri, photoProj, null, null, null);
|
||||
valid = testPhotoUriAndCloseCursor(cursor);
|
||||
displayName = c.getString(c.getColumnIndex(android.provider.ContactsContract.PhoneLookup.DISPLAY_NAME));
|
||||
if (valid) {
|
||||
displayName = c.getString(c.getColumnIndex(android.provider.ContactsContract.PhoneLookup.DISPLAY_NAME));
|
||||
foundPhotoUri = photoUri;
|
||||
c.close();
|
||||
return true;
|
||||
} else {
|
||||
foundPhotoUri = null;
|
||||
}
|
||||
c.close();
|
||||
return true;
|
||||
}
|
||||
c.close();
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue