-1

I call a Fragment ListView in an activity and list the user records, and I want to do a search between those user records. Do I need a little little road show? How can I create this search feature?

Edit : I can describe my problem deeper because it can help.

fatih
  • 67
  • 1
  • 12

2 Answers2

0

You can simply filter items based on a property using Filterable interface if you are using ListView. You can find the implementation here : https://stackoverflow.com/a/24771174/7384780

Abhijeet Kumar
  • 343
  • 2
  • 8
0
  1. It would be better to create a Database in your app and query from it (eg : RoomDB , sqllite ).

  2. Use the DB as your single source of truth to display the items on your View . (This is where you could run your search queries for filtering and any other requirments)

  3. Use Firebase to just populate your DB when the app is loading . This should run in an async thread. I would recommend using RxJava to better handle async functions.

  4. For implementing search Feature , check below official search docs https://developer.android.com/guide/topics/search/ https://developer.android.com/training/search/setup

enter image description here

1nullpointer
  • 1,212
  • 1
  • 13
  • 19