안드로이드 개발 질문/답변
(글 수 45,052)
제가 앱을 작성했는데요.
이미지를 sdcard에서 읽어서 처리해서 다시 저장하는것입니다.
그런데 앱이 에뮬에이터에서는 원만히 잘 동작하는데 안드로이드폰에 넣고 실행시키면
첫번쨰 이미지를 읽을때는 일없는데 두번째 이미지를 읽을때 에러가 떠요.
버젼도 Android2.1-update1로 같게 설정했구요.
왜 그런지 좀 가르쳐주세요.
2010.10.06 12:11:12
dingpong님의 답변 감사하네요.
모르는게 많아서 자꾸 신세집니다.
에러가 뜨는 함수는 다음과 같이 작성되였습니다.
private void fileStart()
{
Intent intent = new Intent(AnimateImage.this, ImageActivity.class);
CheckBox check = (CheckBox)findViewById(R.id.FilterSetting);
bFilterSetting = check.isChecked();
intent.putExtra("FilterSetting", bFilterSetting);
intent.putExtra("PhotoZoom", iPhotoZoom);
intent.putExtra("MosaicSize", iMosaicSize);
intent.putExtra("ImageName", imageName);
Log.d(TAG,imageName);
saveParce = null;
saveBitmap = null;
startActivityForResult(intent, 2);
}
startActivityForResult(intent, 2);에 의해 다른 액티비티가 기동하구요.
그 액티비티에서 이미지 처리를 해서 비트맵형식으로 결과를 돌려줍니다.
그 결과를 처리하는 부분은 다음과 같구요.
public void onActivityResult(int requestCode, int resultCode, Intent data)
{
if(requestCode == 2)
{
if(resultCode == Activity.RESULT_OK)
{
saveParce = data.getParcelableExtra("SaveImage");
saveBitmap =(Bitmap)saveParce;
Log.d(TAG, saveParce.toString());
}
}
}
코드형식은 이상과 같습니다.
그런데 fileStart()함수를 처음 호출할때에는 에러가 안 뜨는데
두번째 호출할떄 나옵니다.
메모리해제를 제대로 하지 않아서 그러는것 같애서 그 부분을 보는데 제 생각이 옳은지요.
그리고 오류통보문은 예상치 않은 오류라고 나옵니다.
도와주시기 바랍니다.



