Bablu
Bablu

Reputation: 459

make custom filter for autocompletetextview android

hi my task is simple that make a autocompletetextview and show matched text in dropdown. But i want to change in filter.

Ex: my list is like D.Y.Patil College,Pune unversiry etc. I want that when user type dy or dyp it stat matching and display result.

How could i ignore whitespace and dot.

And also Could u plz tell me to how exactly autocompletetextview works.

Upvotes: 0

Views: 1080

Answers (1)

Nitin Patel
Nitin Patel

Reputation: 1651

Using by default adapter and filter, autocompletetextview can do only single line string in dropdown view as default adapter and default filter adapter.getFilter().filter(s.toString()); which can do filtering with condition of inputString.contains(stringOfList) one-bye-one and get and display that list in dropdown at autocompletextview.

There for you have to make simple custom adapter and inside that custom filter class for filtering as per your requirement.

Upvotes: 1

Related Questions