title: Unable to convert BLOB to String
body: <p>In my code, the user supposed to add details of a product including name, image, category and other details. But after entering the data and saving it, it cannot view the data that they input. Instead it shows: unable to convert BLOB to String.</p>
  <p>My coding for adding data.</p>
  <pre><code>items Item= new items();
  db.getWritableDatabase();
  ByteArrayOutputStream stream = new ByteArrayOutputStream();
  byte imageInByte[] = stream.toByteArray();
  Bitmap bMap= BitmapFactory.decodeByteArray(imageInByte, 0, imageInByte.length);
  ivThumbnailPhoto.setImageBitmap(bMap);
  Item.setName(name.getText().toString());
  Item.setCategory(SpCate.getSelectedItem().toString());
  Item.setDetails(details.getText().toString());
  Item.setImage(imageInByte);
  db.addItemSpinner(new items());
  // Save the Data in Database
  MyDb entry= new MyDb(SellingItem.this);
  entry.getWritableDatabase();
  entry.addItemSpinner(Item);
  entry.close();
  Toast.makeText(getApplicationContext(), &quot;Account Successfully Created &quot;, Toast.LENGTH_LONG).show();
  Log.d(&quot;name&quot;, Item.getName());
  Log.d(&quot;category&quot;, Item.getCategory());
  Log.d(&quot;detailsL&quot;, Item.getDetails());
  Intent i=new Intent(SellingItem.this,SearchItem.class);
  startActivity(i); 
  </code></pre>
  <p>My Database to input data.</p>
  <pre><code>public void addItemSpinner(items i) {
      SQLiteDatabase db = this.getWritableDatabase();
      ContentValues values = new ContentValues();
      values.put(COLUMN_NAME, i.name); // Contact Name
      values.put(COLUMN_IMAGE, i.image); // Contact Phone
      values.put(COLUMN_CATE, i.category); // Contact Name
      values.put(COLUMN_DETAILS, i.details); // Contact Phone
  
      // Inserting Row
      db.insert(TABLE_NAME, null, values);
      db.close(); // Closing database connection
  }
  </code></pre>
  <p>logcat shows this.</p>
  <pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.projectonline/com.example.projectonline.SearchItem}: android.database.sqlite.SQLiteException: unknown error (code 0): Unable to convert BLOB to string
  </code></pre>
  <p>This is my items code.</p>
  <pre><code>package com.example.projectonline;
  
  import android.graphics.Bitmap;
  
  public class items {
      int id;
      String name, category, details;
      byte[] image;
      
      public items(){
          
      }
  
      public items(int id, String name, String category, byte[]image, String details)
      {
          this.id=id;
          this.name= name;
          this.category=category;
          this.image= image;
          this.details=details;
      }
  
      public items(String name, String category, byte[]image, String details){  
          this.name = name;  
          this.category = category;  
          this.image = image;  
          this.details = details;  
      }  
  
      public String getDetails() {
          return details;
      }
  
      public void setDetails(String details) {
          this.details = details;
      }
  
      public byte[] getImage() {
          return image;
      }
  
      public void setImage(byte[] image) {
          this.image = image;
      }
  
      public int getId() {
          return id;
      }
  
      public void setId(int id) {
          this.id = id;
      }
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
      public String getCategory() {
          return category;
      }
  
      public void setCategory(String category) {
          this.category = category;
      }
  
      public Bitmap getBitmap() {
          // TODO Auto-generated method stub
          return null;
      }
  }
  </code></pre>
  <p>And this is what my DB looks like</p>
  <pre><code>public static final String TAG = &quot;MyDb&quot;;
  public static final String TABLE_NAME=&quot;PRODUCT&quot;;
  public static final String COLUMN_ID=&quot;id&quot;;
  public static final String COLUMN_NAME=&quot;name&quot;;
  public static final String COLUMN_CATE=&quot;category&quot;;
  public static final String COLUMN_IMAGE=&quot;image&quot;;
  public static final String COLUMN_DETAILS=&quot;details&quot;;
  
  private static final String DATABASE_NAME=&quot;Spinner&quot;;
  private static final int DATABASE_VERSION= 1;
  
  private static final String SQL_CREATE_ITEM = &quot;CREATE TABLE &quot; + TABLE_NAME + &quot;(&quot;
          + COLUMN_ID + &quot; INTEGER PRIMARY KEY AUTOINCREMENT, &quot;
          + COLUMN_NAME + &quot; TEXT NOT NULL, &quot;
          + COLUMN_CATE + &quot; TEXT NOT NULL, &quot;
          + COLUMN_IMAGE + &quot; BLOB, &quot;
          + COLUMN_DETAILS + &quot; TEXT NOT NULL &quot;
          +&quot;)&quot;;
  </code></pre>