Images in SimpleCursorAdapter

后端 未结 3 1182
南方客
南方客 2020-12-03 19:16

I\'m trying to use a SimpleCursorAdapter with a ViewBinder to get an image from the database and put it into my ListView item view. He

3条回答
  •  春和景丽
    2020-12-03 19:47

    I think the cursor.moveToFirst() has not been called so the cursor is throwing android.database.CursorIndexOutOfBoundsException.

    Before using a cursor you should always check is the cursor is empty or not by calling cursor.moveToFirst(). This will also position the cursor at the first position.

提交回复
热议问题