mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-06-05 21:59:27 +02:00
ignore phone number entries without a number
This commit is contained in:
parent
83418936f5
commit
71d40b0e08
@ -106,14 +106,15 @@ class ContactsHelper(val activity: BaseSimpleActivity) {
|
|||||||
if (cursor?.moveToFirst() == true) {
|
if (cursor?.moveToFirst() == true) {
|
||||||
do {
|
do {
|
||||||
val id = cursor.getIntValue(ContactsContract.Data.RAW_CONTACT_ID)
|
val id = cursor.getIntValue(ContactsContract.Data.RAW_CONTACT_ID)
|
||||||
val number = cursor.getStringValue(CommonDataKinds.Phone.NUMBER)
|
val number = cursor.getStringValue(CommonDataKinds.Phone.NUMBER) ?: continue
|
||||||
val type = cursor.getIntValue(CommonDataKinds.Phone.TYPE)
|
val type = cursor.getIntValue(CommonDataKinds.Phone.TYPE)
|
||||||
|
|
||||||
if (phoneNumbers[id] == null) {
|
if (phoneNumbers[id] == null) {
|
||||||
phoneNumbers.put(id, ArrayList())
|
phoneNumbers.put(id, ArrayList())
|
||||||
}
|
}
|
||||||
|
|
||||||
phoneNumbers[id].add(PhoneNumber(number, type))
|
val phoneNumber = PhoneNumber(number, type)
|
||||||
|
phoneNumbers[id].add(phoneNumber)
|
||||||
} while (cursor.moveToNext())
|
} while (cursor.moveToNext())
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user