6

Can anyone tell me what this is about. Im getting this error when i am adding data in database. its Happening only for a particular row. I tried finding answer or reason over the internet. but in vain. The screenshot Screenshot while debugging

public void FunSetVisitorDetails(String strResult) {
    Log.d(TAG, "Get Visitor Details started.");
    if (!strResult.equalsIgnoreCase("NA") && !strResult.equalsIgnoreCase("NI")) {
        SQLiteDatabase database = getWritableDatabase();
        database.delete("TBL_VISITOR_MASTER", null, null);
            String[] strResultData = strResult.split("#");
            for (int index = 0; index < strResultData.length; index++) {
                String[] strRowData = strResultData[index].split(",");
                ContentValues values = new ContentValues();
                values.put("VISITORID", strRowData[0]);
                values.put("MEMBERID", strRowData[1]);
                values.put("TEAMID", strRowData[2]);
                values.put("CATEGORY", strRowData[3]);
                values.put("NAME", strRowData[4]);
                values.put("COMPNAME", strRowData[5]);
                values.put("SPECIALIZED1", strRowData[6]);
                values.put("SPECIALIZED2", strRowData[7]);
                values.put("SPECIALIZED3", strRowData[8]);
                values.put("SPECIALIZED4", strRowData[9]);
                values.put("SPECIALIZED5", strRowData[10]);
                values.put("CLIENT1", strRowData[11]);
                values.put("CLIENT2", strRowData[12]);
                values.put("CLIENT3", strRowData[13]);
                values.put("CLIENT4", strRowData[14]);
                values.put("CLIENT5", strRowData[15]);
                values.put("ASK", strRowData[16]);
                values.put("GIVE", strRowData[17]);
                values.put("TAGLINE", strRowData[18]);
                values.put("EMAIL", strRowData[19]);
                values.put("MOBILE", strRowData[20]);
                values.put("WEBSITE", strRowData[21]);
                values.put("LOCATION", strRowData[22]);
                try{ 
                    values.put("COMP_LOGO", strRowData[23]);// it is happening when adding the logo and image below. there is no exception thrown as well.
                    values.put("PERSON_IMAGE", strRowData[24]);
                } catch (Exception e){
                    e.printStackTrace();
                }

                database.insert("TBL_VISITOR_MASTER", null, values);
            }
Rahul Agrawal
  • 521
  • 6
  • 24

1 Answers1

0

I guessed the error in saving the image. You need to save the bitmap image for the specific row. So create the column as BLOB and save the image of bytes on that.

You will find many tutorials like THIS.

Riad
  • 3,822
  • 5
  • 28
  • 39