커서를 사용하여 sqlite 데이터베이스에서 imageview에 이미지를 표시하고 싶습니다. 아래 코드를 사용하여 이미지를 검색했지만 이미지 뷰어에 이미지를 표시 할 수 없습니다.android에서 커서를 사용하여 sqlite 데이터베이스에서 이미지 표시
Cursor c=this.db.query(TABLE_NAME, new String[] { "name","price","image" },
null, null, null, null, null);
name.setText(c.getString(0));
price.setText(c.getString(1));
byte b[]=c.getBlob(2);
Bitmap bp=BitmapFactory.decodeByteArray(b, 0, b.length);
ImageView image=(ImageView)findViewById(R.id.ImageView);
//ByteArrayInputStream imageStream = new ByteArrayInputStream(b);
//Bitmap theImage = BitmapFactory.decodeStream(imageStream);
//image.setImageBitmap(theImage);
image.setImageBitmap(bp);
이미지 이외의 이름, 가격은 표시되지만 이미지는 표시되지 않습니다. 이 문제를 해결하는 데 도움이되는 제안이나 코드.
도와주세요. 내가 대신 바이트 배열 스트림을 사용하려고했습니다
'이미지'열에 대한 SQLite db의 필드 유형은 무엇입니까? – Brian