カーソルによって返された Uri (sqlite データベース列内) から imageView を設定しようとしていますが、機能していません。
コード:
mCursor = mydb.rawQuery("select * from events;", null);
if (mCursor != null ) {
mCursor.moveToFirst();
String[] from = new String[]{DbHandler.column_id, DbHandler.column_name, DbHandler.column_location, DbHandler.column_date, DbHandler.img_loc};
int[] to = new int[] {R.id.textView1, R.id.textView2, R.id.textView3, R.id.textView4, R.id.photoInDb};
SimpleCursorAdapter simpleCurs = new SimpleCursorAdapter(this, R.layout.listviewfinal, mCursor, from, to);
simpleCurs.setViewBinder(new SimpleCursorAdapter.ViewBinder() {
@Override
public boolean setViewValue(View view, Cursor cursor, int i) {
if (view instanceof ImageView) {
ImageView image = (ImageView) view;
// just to see what is returned by this!
Log.d("orange", "images: " + cursor.getString(i));
Bitmap thumbImage = ThumbnailUtils.extractThumbnail(BitmapFactory.decodeFile(cursor.getString(i)), 320, 240);
image.setImageBitmap(thumbImage);
return true;
}
return false;
}
});
listView.setAdapter(simpleCurs);
何か案は?