아래와 같이 이미지를 이미지뷰에 설정해봣습니다
한번에 약 100번을 루프를 돕니다
=====================================================
class AccumulateTask extends AsyncTask<Integer, Integer, Integer> {
protected void onPreExecute() {
}
protected Integer doInBackground(Integer... params) {
try{
int id = params[0];
int listPos = params[1];
String imagePath = CommonUtilities.SEVER_URL+"/seouleTollet/images/"+ temp_imgpath[id];
/// Log.i("AccumulateTask", "id = "+id + " == "+imagePath+ " == "+FNAME[id]);
BitmapFactory.Options resizeOpts = new Options();
resizeOpts.inSampleSize = 4;
resizeOpts.inJustDecodeBounds = false;
resizeOpts.inPurgeable = true;
InputStream is = new URL(imagePath).openStream();
Bitmap bit = BitmapFactory.decodeStream(is,null, resizeOpts);
// PensionListItem Item = (PensionListItem)pensionItem.get(id);
PensionListItem Item = (PensionListItem)pensionItem.get(listPos);
Item.setMyImg(bit);
pensionList.notifyAll();
bit = null;
is.close();
//resizeOpts = null;
}catch(Exception e){
}
return 0;
}
protected void onProgressUpdate(Integer... progress) {
//dialog.progressDialogClose();
}
protected void onPostExecute(Integer result) {
}
protected void onCancelled() {
//dialog.progressDialogClose();
}
}
약600번을 돌리면 OutOfMemory가 발생합니다
bitmap.recycle();
bitmap = null;
이렇게도 해봤는데도 에러가 발생해서 어플이 죽습니다
도대체 어떻게 해야하나요?