카메라로 찍고 찍은 사진을 보내서 가공하는것은 잘 되고 있구요...
현재 겔러리에서 사진 선택시 선택된 사진 불러오는 기능을 구현중에 있습니다.
//클릭이벤트로 겔러리를 엽니다.
albumBtn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("image/*"); //MIME type으로 image를 주어야 한다.
startActivityForResult(intent, requestCode1); //request code로 임의의 값을 사용.
dismissDialog(CUSTOM_DIALOG_BOX);
}
});
//결과
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Log.e("DAY", "RequestCode: " + requestCode + "ResultCode: "+ resultCode);
finishActivity(requestCode);//위에서 겔러리를 부름으로 인해 생기는 Activity를 강제로 종료시켜준다. 동작이 안될 수도 있다..
if (requestCode == requestCode1 && resultCode == RESULT_OK) {
try {
Uri selPhotoUri = data.getData(); //Uri curImg에 저장됨
Bitmap selPhoto = Images.Media.getBitmap(getContentResolver(),selPhotoUri);
/*
* 겔러리에서 받아온 이미지가 너무 크면 Out of Memory 가 발생함으로 1/4로 스케일 해준다.
*/
//Bitmap resized = Bitmap.createScaledBitmap(selPhoto, selPhoto.getWidth() / 4, selPhoto.getHeight() / 4, true);
Intent intent = new Intent(ViewActivity.this, ReportActivity.class);
intent.putExtra("Bitmap", selPhoto);
startActivity(intent);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
이런식으로 했는데 오류는 안나고
Intent intent = new Intent(ViewActivity.this, ReportActivity.class);
intent.putExtra("Bitmap", selPhoto);
startActivity(intent);
이 인텐트 구문이 먹지않고 바로 ViewActivity 로 이동합니다..
왜 인텐트 구문이 먹지 않는걸가요 인텐트 구문 사이사이에 log 다 찍어봤는데 돌긴 하는데...
왜 인텐트 먹지 않고 그냥 읽기만하고 원래 ViewActivity 로 돌아가는지 궁급합니다..ViewActivity 로
가라고 지정하지도 안았는데... ㅠㅠ
고수분의 부드러운 손길이 필요합니다..^^;
SMS 입니다.
ReportActivity는 Intent로 넘긴 Bitmap 이미지를 그냥 받아서 보여주는 단순한 페이지 입니다.
당연히 ReportActivity로 넘어갈 줄 알았는데 안넘어가서요..히안하네 왜 안넘어가노..
Bitmap selPhoto = Images.Media.getBitmap(getContentResolver(),selPhotoUri);
Log.d("Bitmap", selPhoto);
/*
* 겔러리에서 받아온 이미지가 너무 크면 Out of Memory 가 발생함으로 1/4로 스케일 해준다.
*/
//Bitmap resized = Bitmap.createScaledBitmap(selPhoto, selPhoto.getWidth() / 4, selPhoto.getHeight() / 4, true);
Intent intent = new Intent(ViewActivity.this, ReportActivity.class);
Log.d("1","1");
intent.putExtra("Bitmap", selPhoto);
Log.d("2","2");
startActivity(intent);
Log.d("3","3");
로그는 다 찍히는데 intent에 명령한대로 ReportActivity로 안넘어가염..




돌아다니는 source 짜집기한거라 프로젝트소스라도 보내드릴 수 있습니다..
관심 가져 주셔서 감사합니다~