try filtering out duplicate contacts at the autocomplete suggestions

This commit is contained in:
tibbi 2020-04-05 22:04:21 +02:00
parent dc806c97d0
commit 1b3c6d9dac
1 changed files with 5 additions and 0 deletions

View File

@ -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)
new_message_to.setAdapter(adapter)
new_message_to.imeOptions = EditorInfo.IME_ACTION_NEXT