We have a long list of item and it is difficult to find out a particular item in the list. In such scenario searching is useful.
Today I am going to demonstrate searching the list.
1. Create a layout with ListView I created activity_main.xml
In this I use by default relativeLayout and one EditText view where we type searching element. and a listView where we show our list item.
Now I am creating layout for show list item. I am show only string so I will take single TextView.
Now i am going to create a simple class to create list of string you can manually insert list item in Arraylist to display in list
This is launcher activity which is implementing TexWatcher which is used to check change in charcter which we type in the search box i.e. edit text view.
Now we are going to create Custum adapter class which is extending BaseAdapter and implementing Filterable which give us Filter class
You can Download complete project from Github
If have any problem mention in comment.