public class ImageAdapter extends BaseAdapter {
LayoutInflater inflater;
ImageView photo;
CheckBox CHECK;
BitmapFactory.Options options;
public ImageAdapter(Context c) {
inflater = (LayoutInflater)c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
public int getCount() {
return receivedphoto.size();
}
public Object getItem(int position) {
return receivedphoto.get(position);
}
public long getItemId(int position) {
return position;
}
public View getView(int position, View convertView, ViewGroup parent) {
if(convertView == null) {
convertView = inflater.inflate(R.layout.phototab_list, parent, false);
photo = (ImageView)convertView.findViewById(R.id.PHOTOS);
CHECK = (CheckBox)convertView.findViewById(R.id.PHOTOSCHECK);
options = new BitmapFactory.Options();
options.inSampleSize = 16;
}
Log.i("LOAD", position + "");
if(ReceivePhotos.get(position) == null) {
ReceivePhotos.set(position, BitmapFactory.decodeFile((String)(receivedphoto.get(position)), options));
}
photo.setImageBitmap(ReceivePhotos.get(position));
int check = Photoischeck.get(position);
if(check == 0) {
CHECK.setChecked(false);
} else {
CHECK.setChecked(true);
}
return convertView;
}
}
ArrayList を GridView データとして使用します。しかし、下にスクロールして上にスクロールすると、写真が混在します。混合は、写真の位置が変更されることを意味します。何故ですか?助けてくださいㅠㅜ