can you have a layout with an imageview and textview for a row in a SimpleCursorAdapter with a listview?
this would be the layout
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/bowler_txt"
android:paddingLeft="25dp"
android:textSize="30dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Bowler"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
can it be done in SimpleCursorAdapter with a listview? when I needed images in a listview I always used a custom arrayadapter but never with a cursor.
How would I set the image if it can be done?
When the view to bind is an
ImageViewand there is no existingViewBinderassociatedSimpleCursorAdapter.bindView()callssetViewImage(ImageView, String).By default, the value will be treated as an image resource. If the value cannot be used as an image resource, the value is used as an image Uri.
If you need to filter in other ways the value retrieved from the database you need a
ViewBinderto add to theListAdapteras follow: