From 6cc0c6ea151d64ad3a0680f1d735619ecea469b9 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 21 Nov 2018 18:47:20 +0100 Subject: [PATCH] improve the way contacts are searched by phone numbers --- .../simplemobiletools/contacts/pro/helpers/ContactsHelper.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/ContactsHelper.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/ContactsHelper.kt index d84acd23..1ab00f31 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/ContactsHelper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/ContactsHelper.kt @@ -96,8 +96,8 @@ class ContactsHelper(val activity: Activity) { Thread { val uri = CommonDataKinds.Phone.CONTENT_URI val projection = arrayOf(ContactsContract.Data.RAW_CONTACT_ID) - val selection = "${CommonDataKinds.Phone.NORMALIZED_NUMBER} = ?" - val selectionArgs = arrayOf(number.normalizeNumber()) + val selection = "${CommonDataKinds.Phone.NUMBER} = ? OR ${CommonDataKinds.Phone.NORMALIZED_NUMBER} = ?" + val selectionArgs = arrayOf(number, number.normalizeNumber()) var cursor: Cursor? = null try {