lundi 6 juillet 2015

how to read image from Sqlite according to id and display in image-view android

@Override
public void onCreate(SQLiteDatabase db) {
    db.execSQL("CREATE TABLE " + INFR_TABLE
            + "(_id INTEGER PRIMARY KEY NOT NULL," + CATEGORY + " integer,"
            + STATUS + " text, " + FEEDBACK + " text, " + DATE + " text,  "
            + IMAGE + " BLOB)");

    System.out.println("Database Createeeeeeeeeeeeeee");

}




public byte getimage( String id)

    {
        db = this.getReadableDatabase();
        cursor = db.query(INFR_TABLE, new String[] { "_id", "cateogry",
                "status", "feedback", "date", "image" }, null, null, null,
                null, null);

        return 0;

    }

I am saving Image in database in Blob i want to fetch particular image on base of id but i am unable to fetch in Byte coz i have to print it in image view please help me how to fetch image from database on base of id .

Aucun commentaire:

Enregistrer un commentaire