What's the algorithm to get all string X from column Y and return as a cursor? I need a function which returns the cursor multiple times, so the algorithm has to account for that.
I'll really appreciate it.
UPDATE:
public Comment search1(){
List<Comment> comments = new ArrayList<Comment>();
Cursor cursor = database.query(MySQLiteHelper.TABLE_COMMENTS,
allColumns, MySQLiteHelper.COLUMN_NAME +" LIKE" + "'%QUERY%'", null, null, null, null);
cursor.moveToFirst();
Comment newComment = new Comment();
//set values of this comment
newComment = cursorToComment(cursor);
//Close cursor
cursor.close();
return newComment;
}
Ignore the Comment part it's what I use for the ListView Adapter.