How to search in a List of Object that the Object's attribute contains a string

4uk4a

New Member
I have a case of following:
  • I have an object called \[code\]Song\[/code\] with one of its attribute is \[code\]Name\[/code\].
  • I have a sqlite database that can contain the Song up to million records.
  • I need to do a live search (upon user tapping a letter, the app will directly search it) for the Song's Name attribute.
The solution that I've been thinking (I haven't done any code) is:[*]Directly querying the sqlite (I believe this is the worst solution because I need to fetch from sqlite and put it to \[code\]Cursor\[/code\])[*]Put all the sqlite records to List or ArrayList, then I'm not sure where to proceed as I believe to do for loop is not the best solution as I need to store to other List to prepopulate my \[code\]ListView\[/code\]Can anyone give me the idea, maybe the concept only, to solve this?
 
Back
Top