I have a ListView:
...
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@id/android:list" android:layout_width="fill_parent" android:layout_height="wrap_content" android:drawSelectorOnTop="false" android:scrollingCache="true" android:fastScrollEnabled="true" android:choiceMode="singleChoice" android:background="?android:attr/colorBackground" android:layout_weight="1" android:cacheColorHint="?android:attr/colorBackground" android:fadingEdge="none"/>
...
And a layout for the list items:
...
<ImageView
android:id="@+id/folder_image"
android:src="@drawable/icon_folder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="5dip"
android:paddingTop="3dip"/>
<TextView
android:id="@+id/fol_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="22dip"
android:layout_toRightOf="@+id/folder_image"/>
...
The ListView is populated from a database using a setListAdapter(SimpleCursorAdapter). For each row, I want to display an image (a folder icon). However, for two specific rows (assume I know how to identify the rows using, for example, some sort of indicator) I'd like to display different images. Let's assume that I have an undetermined number of folders and a folder icon will be displayed for each row along side the folder's name. Let's also assume that I have, for example, a Word doc and an Excel file, exactly one of each, and I'd like to display the appropriate images for each.