SkImageDecoder::Factory returned null error in android
<p>I am trying to save the image in the SQLite table and retrieve it to show on ImageView component.but nothing is getting I am using following code.What is possibly going wrong.</p>

<pre><code>try
{
    Bitmap bmp=BitmapFactory.decodeResource(this.getResources(),R.drawable.speed);
    ByteArrayOutputStream bos=new ByteArrayOutputStream();
    bmp.compress(CompressFormat.JPEG, 100,bos);
    byte[] bitmapbyte=bos.toByteArray();

    myDB=openOrCreateDatabase("photo.db",SQLiteDatabase.OPEN_READWRITE, null);
    myDB.execSQL("DROP TABLE IF EXISTS "+ TableName);
    myDB.execSQL("CREATE TABLE IF NOT EXISTS "+ TableName + " (id INT(5),pic BLOB);");
    myDB.execSQL("INSERT INTO "+ TableName +"(id,pic) VALUES (1,'"+bitmapbyte+"');");

    Cursor c=myDB.rawQuery("Select pic from "+ TableName +" where id=1",null);
    c.moveToFirst();

    imv.setImageBitmap(getImageFromBLOB(c.getBlob(c.getColumnIndex("pic"))));
}
catch(Exception e)
{
    e.printStackTrace();
}
}

//getImageFromBLOB method
public Bitmap getImageFromBLOB(byte[] mBlob) 
{
    byte[] bb = mBlob;
    ByteArrayInputStream imageStream = new ByteArrayInputStream(bb); 
    return BitmapFactory.decodeStream(imageStream);
}
</code></pre>

<p>Kindly help please.Thanks.</p>
