how to put images in gallery from the database? Android
<p>how to put images in gallery from the database?</p>

<pre><code>int background = 7;
private Context context;
ByteArrayInputStream inputStream;
Bitmap bit[];
private int[] imageID = { 
};

public ImageAdapter(Context c) {
    // TODO Auto-generated constructor stub
    context = c;
    TypedArray attr = context
            .obtainStyledAttributes(R.styleable.ApplicantPhotos);
    background = attr.getResourceId(
            R.styleable.ApplicantPhotos_android_galleryItemBackground,  0);
    attr.recycle();

}
//  public void setImage(ContentResolver cr,int id){
//      
//      Cursor cu = cr.query(CONTENT_URI_rawquery, null, "SELECT * FROM Images",   null, null);
//      int i=0;
//      bit=new Bitmap[cu.getCount()];
//      while(cu.moveToNext()){
//          inputStream=new   ByteArrayInputStream(cu.getBlob(cu.getColumnIndex(Image)));
//          bit[i] = BitmapFactory.decodeStream(inputStream);
//          i++;
//      }
//  }


//     public void add(Bitmap y){
//       Log.i("Lob B", y.toString());
//       for(int i=0;i&lt;bit.length;i++){
//             bit[i] = new Bitmap(y);
//       }
//     }

@Override
public int getCount() {
    // TODO Auto-generated method stub
    return imageID.length;
}

@Override
public Object getItem(int position) {
    // TODO Auto-generated method stub
    return position;
}

@Override
public long getItemId(int position) {
    // TODO Auto-generated method stub
    return position;
}

@Override
public int getItemViewType(int position) {
    // TODO Auto-generated method stub
    return position;
}

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    // TODO Auto-generated method stub
    ImageView imageView = new ImageView(context);
    imageView.setImageBitmap(bit[position]);
    imageView.setLayoutParams(new Gallery.LayoutParams(150, 100));
    imageView.setScaleType(ImageView.ScaleType.FIT_XY);
    imageView.setBackgroundResource(background);
    return imageView;
}

@Override
public int getViewTypeCount() {
    // TODO Auto-generated method stub
    return 0;
}

@Override
public boolean hasStableIds() {
    // TODO Auto-generated method stub
    return false;
}

@Override
public boolean isEmpty() {
    // TODO Auto-generated method stub
    return false;
}

@Override
public void registerDataSetObserver(DataSetObserver observer) {
    // TODO Auto-generated method stub

}

@Override
public void unregisterDataSetObserver(DataSetObserver observer) {
    // TODO Auto-generated method stub

}

@Override
public View getDropDownView(int position, View convertView, ViewGroup parent) {
    // TODO Auto-generated method stub
    return null;
}
}
</code></pre>
