Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addRecipient - duplicate chips #62

Open
azusdex opened this issue Dec 12, 2018 · 0 comments
Open

addRecipient - duplicate chips #62

azusdex opened this issue Dec 12, 2018 · 0 comments

Comments

@azusdex
Copy link

azusdex commented Dec 12, 2018

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?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant