try this adapter for gallary,
public class ImageAdapter extends BaseAdapter {
private Context mContext;
public ImageAdapter(Context c) {
mContext = c;
aQuery = new AQuery(c);
}
public int getCount() {
return myImageList.length;
}
public Object getItem(int position) {
return position;
}
public long getItemId(int position) {
return position;
}
@SuppressWarnings("deprecation")
public View getView(final int pos, View arg1, ViewGroup arg2) {
ImageView i = new ImageView(mContext);
i.setLayoutParams(new Gallery.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
i.setScaleType(ScaleType.FIT_XY);
i.setImageResource(myImageList[pos]);
return i;
}
}