splitwise / TokenAutoComplete

Gmail style MultiAutoCompleteTextView for Android
Apache License 2.0
1.3k stars 384 forks source link

Can't clear view text #376

Closed IstrateAndrei closed 5 years ago

IstrateAndrei commented 5 years ago

I've added a TextChangedListener to my custom view in order to filter a list of objects when i type any text in the input field. After I tap on one item from the filtered list I added to the view using view.addObject(item). After I successfully added an item, the onTokenAdded(token: T) method is called from within my TokenCompleteTextView.TokenListener. I want to clear the text from the input field after an item was added but I get an IndexOutOfBoundsException

Any idea on how to do that?

mgod commented 5 years ago

You shouldn't need to manage the filtering or list display yourself. You'll need to provide a filterable ListAdapter and let the library handle showing the drop down. Can you give me some more details on what you need that the default behavior doesn't handle?

You might be able to resolve this with clearCompletionText.

mgod commented 5 years ago

There's also some discussion on this for #163.

IstrateAndrei commented 5 years ago

Thanks man, found the solution in #163