addRecipient - duplicate chips
azusdex opened this issue · comments
Hi,
I added contacts with method addRecipient, and get duplicate chips.
Here my code:
activity.xml
<com.android.ex.chips.RecipientEditTextView android:id="@+id/phone_retv" android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:textColor="@color/colorPrimary" android:fontFamily="@font/montserrat" android:minHeight="58dp" />
on Activity.kt
lateinit var numbersTo: RecipientEditTextView
override fun onCreate(savedInstanceState: Bundle?) {
...
numbersTo = findViewById(R.id.phone_retv)
numbersTo.maxChips = 10
numbersTo.setTokenizer(MultiAutoCompleteTextView.CommaTokenizer())
val adapterRecipientEditTextView =
BaseRecipientAdapter(BaseRecipientAdapter.QUERY_TYPE_PHONE, this)
adapterRecipientEditTextView.isShowMobileOnly = true
numbersTo.setAdapter(adapterRecipientEditTextView)
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
...
val entry = RecipientEntry.constructGeneratedEntry(displayName, mainNumber, true)
numbersTo.addRecipient(entry)
}
this a result:
![screenshot_1544651248](https://user-images.githubusercontent.com/4046890/49900816-50c5e300-fe68-11e8-8e92-556b4b10259b.png)
You can help me?