Monday, 30 June 2014

List View With Search Option And Pagination


In general search option in list view is implemented by setting an addTextChangeListener
on EditText control where we should apply an filter on the list view by getting an i/p from
user which he enters on Edit Text and that filter will populate the data based on that filter.

But In some situations we need to populate the data based on custom search for example
If the list view is showing list of "Contact Objects" and user need to search based on both
the combinations of "name and phone" then we need to write our own search logic based
on the requirement.

And if the resultant search returns 100's of record you need to implement pagination for it.

You can Download the Source Code below.

DOWNLOAD NOW

In List View I have populated Contact Details

Like
Name1  email1  Phone1 Add1 add2
........................................................
........................................................
........................................................
Name20 email20 phone20 Add20 add20

while u test this application for search option u need to give i/p as follows
Name: name 1  etc..
Phone: phone 1 etc..

No validation are done for empty field and email address.

I will keep on updating when ever I get time.



Final Result

Image 1

Image 2

Image 3


   


 
 
Image 4  

No comments:

Post a Comment