0
//MyOpenHelper class 


public static final String TABLE_NAME2 = "Catlog_Chield";
db.execSQL("CREATE TABLE IF NOT EXISTS "+TABLE_NAME2+" (_id INTEGER PRIMARY KEY AUTOINCREMENT,log_desc TEXT,log_date TEXT,log_image BLOB,cat_id INTEGER,FOREIGN KEY (cat_id) REFERENCES "+TABLE_NAME1+"(_id))");

//My working class


 ByteArrayInputStream inputStream =   
    new ByteArrayInputStream(c.getBlob(c.getColumnIndex(log_image))); //Here I can't give my column name log_name
    Bitmap bp=BitmapFactory.decodeStream(inputStream);

    image.setImageBitmap(bp);
4

1 に答える 1

0

この方法を試してください:

   byte[] image_bytes = c.getBlog(c.getColumnIndex(Here you need to give index));
   ByteArrayInputStream inputStream =   
   new ByteArrayInputStream(image_bytes); 
   Bitmap bp=BitmapFactory.decodeStream(inputStream);

// setImageBitmap メソッドを使用して画像を設定します

于 2012-07-26T12:30:49.470 に答える