I am trying to add an image next to each item in my ListView but without any success so far. There is a DB, from where I retrieve the text data, like this:
Cursor categoriesCursor = myCategoryData.getCategoriesData();
String[] displayCategories = new String[]{ CategoryDataSource.NAME};
int[] displayViews = new int[]{R.id.list_name};
setListAdapter(new SimpleCursorAdapter(
this,
R.layout.list_category,
categoriesCursor,
displayCategories,
displayViews,1));
myListView = getListView();
Then I create an array to store the image IDs
Integer[] imageIds = new Integer[]{
R.drawable.cat1,
R.drawable.cat2,
R.drawable.cat3,
};
What I cannot figure out is how to bind them together. Thanks a lot for the help!