if (cursor.moveToFirst()) { do { Question quest = new Question(); quest.setID(cursor.getInt(0)); quest.getBitmap(cursor.getBlob(1)); //error is here quest.setQUESTION(cursor.getString(2)); quest.setANSWER(cursor.getString(3)); quest.setOPTA(cursor.getString(4)); quest.setOPTB(cursor.getString(5)); quest.setOPTC(cursor.getString(6)); quesList.add(quest); } while (cursor.moveToNext()); } // return quest list return quesList;
package com.JAFNS.pediakids; import android.graphics.Bitmap; public class Question { private int ID; private Bitmap bmp; private String QUESTION; private String OPTA; private String OPTB; private String OPTC; private String ANSWER; public Question() { ID=0; QUESTION=""; OPTA=""; OPTB=""; OPTC=""; ANSWER=""; } public Question(Bitmap b, String qUESTION, String oPTA, String oPTB, String oPTC, String aNSWER) { bmp = b; QUESTION = qUESTION; OPTA = oPTA; OPTB = oPTB; OPTC = oPTC; ANSWER = aNSWER; } public int getID() { return ID; } public Bitmap getBitmap(){ return bmp; } public String getQUESTION() { return QUESTION; } public String getOPTA() { return OPTA; } public String getOPTB() { return OPTB; } public String getOPTC() { return OPTC; } public String getANSWER() { return ANSWER; } public void setID(int id) { ID=id; } public void setQUESTION(String qUESTION) { QUESTION = qUESTION; } public void setOPTA(String oPTA) { OPTA = oPTA; } public void setOPTB(String oPTB) { OPTB = oPTB; } public void setOPTC(String oPTC) { OPTC = oPTC; } public void setANSWER(String aNSWER) { ANSWER = aNSWER; } public void getBitmap(Bitmap b) { // TODO Auto-generated method stub this.bmp = b; } }
cursor.getBlob(1)
byte[]
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)