improve the way contacts are searched by phone numbers
This commit is contained in:
parent
69e3a55a18
commit
6cc0c6ea15
1 changed files with 2 additions and 2 deletions
|
|
@ -96,8 +96,8 @@ class ContactsHelper(val activity: Activity) {
|
||||||
Thread {
|
Thread {
|
||||||
val uri = CommonDataKinds.Phone.CONTENT_URI
|
val uri = CommonDataKinds.Phone.CONTENT_URI
|
||||||
val projection = arrayOf(ContactsContract.Data.RAW_CONTACT_ID)
|
val projection = arrayOf(ContactsContract.Data.RAW_CONTACT_ID)
|
||||||
val selection = "${CommonDataKinds.Phone.NORMALIZED_NUMBER} = ?"
|
val selection = "${CommonDataKinds.Phone.NUMBER} = ? OR ${CommonDataKinds.Phone.NORMALIZED_NUMBER} = ?"
|
||||||
val selectionArgs = arrayOf(number.normalizeNumber())
|
val selectionArgs = arrayOf(number, number.normalizeNumber())
|
||||||
|
|
||||||
var cursor: Cursor? = null
|
var cursor: Cursor? = null
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue