I’m currently using the following code to pass all items in some columns to Arrayadapter.
private void TestListAll(){
//Displays the whole list.
cursor = db.rawQuery("SELECT _id, firstName, lastName, title FROM employee WHERE firstName || ' ' || lastName LIKE ?",
new String[]{"%" + "" + "%"});
adapter = new SimpleCursorAdapter(
this,
R.layout.emp_list_item,
cursor,
new String[] {"firstName", "lastName", "title"},
new int[] {R.id.firstName, R.id.lastName, R.id.title});
setListAdapter(adapter);
}
Is there a better method to accomplish this?
in my app i use somethink like this:
and then, you can put arraylist into adapter 😉
like this:
this is my simple adapter: