Skip to content
Advertisement

How to filter a listview using SearchView

I am using searchView to filter my list view. But the problem is only when I write the full element name then only the list is filtered. For example: I have a list of users – {“Bob”, “John”, “James”}. If I write J in searchView I want both John and James to be seen. But I get a Toast that this name is not in the list. Please help.

JavaScript

Advertisement

Answer

Please try using a FilterListener like this

JavaScript
Advertisement