retrieve image from database
<p>I got null when I am trying to convert bytearray into bitmap. I don't know why. please give me useful suggestions.</p>

<pre><code>    super.onCreate(savedInstanceState);
    setContentView(R.layout.newscreen);
    TextView name = (TextView)findViewById(R.id.textView1);
    TextView age = (TextView)findViewById(R.id.textView2);
    ImageView img = (ImageView)findViewById(R.id.imageView1);

    db = openOrCreateDatabase(
            "StudentData.db"
            , SQLiteDatabase.CREATE_IF_NECESSARY
            , null
        );

    db.setVersion(1);
    db.setLocale(Locale.getDefault());
    db.setLockingEnabled(true);

    Cursor cur = db.query("stuData", 
                null, null, null, null, null, null);
            //cur.moveToFirst();
    cur.moveToFirst();
        //name.setText(cur.getString(1));
        //age.setText(cur.getString(2));

       // if(bb!=null)
        //{


        //ByteArrayInputStream imageStream = new ByteArrayInputStream(bb);
            //bs = new BufferedInputStream(bb)

        //img.setImageBitmap(theImage);
    while (cur.isAfterLast() == false) {
            BitmapFactory.Options options = new BitmapFactory.Options();
            options.inSampleSize=5;
            name.append("n" + cur.getString(1));
            byte[] bb = cur.getBlob(3);


            System.out.print("DAta"+bb);

            for(int i =0;i&lt;bb.length;i++)
            {
                System.out.println(bb[i]);
            }
            Bitmap theImage = BitmapFactory.decodeByteArray(cur.getBlob(3),0,cur.getBlob(3).length);

            img.setImageBitmap(theImage);

            cur.moveToNext();
        }
    cur.close();
</code></pre>
