try filtering out duplicate contacts at the autocomplete suggestions
This commit is contained in:
parent
dc806c97d0
commit
1b3c6d9dac
1 changed files with 5 additions and 0 deletions
|
|
@ -52,6 +52,11 @@ class NewMessageActivity : SimpleActivity() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
contacts = contacts.distinctBy {
|
||||||
|
val startIndex = Math.max(0, it.phoneNumber.length - 9)
|
||||||
|
it.phoneNumber.substring(startIndex)
|
||||||
|
}.toMutableList() as ArrayList<Contact>
|
||||||
|
|
||||||
val adapter = AutoCompleteTextViewAdapter(this, contacts)
|
val adapter = AutoCompleteTextViewAdapter(this, contacts)
|
||||||
new_message_to.setAdapter(adapter)
|
new_message_to.setAdapter(adapter)
|
||||||
new_message_to.imeOptions = EditorInfo.IME_ACTION_NEXT
|
new_message_to.imeOptions = EditorInfo.IME_ACTION_NEXT
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue