카메라를 사용할 수있는 방법이 있지만 이미지를 임시로 저장합니까? 그때 내가 촬영 한 이미지를 얻기 위해() onActivityResult를 사용하고, 카메라를로드하려면 다음 코드를 사용하고 (있는 경우 ...)카메라를 시작하지만 이미지를 저장하지 마십시오
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
문제가 촬영이됩니다 것을, 그것은 SD 카드에 저장됩니다.
편집 이미지를 얻을 수 없다 Howver 내가
File imageFile = new File(imagePath);
imageFile.delete();
을 활동 데이터를 반환 (onActivityResult
) 사용하고 있습니다 때 의도는 다음 코드
String imagePath;
imagePath = Environment.getExternalStorageState() + "/images/myimage.jpg";
File file = new File(imagePath);
Uri outputFileUri = Uri.fromFile(file);
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST);
에 의해 불려
삭제됨 또한, 내 갤러리 응용 프로그램으로 향하면 이미지에 기본 이름 (예 : image57465.jpg)이 있는데, 나는 실제로 작동하지 않고 cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
을 asuming하고 있습니다.
EDIT 2
사실, 파일은 SDCARD에 저장되고, 올바르게 삭제. 그러나 미리보기 이미지가 저장되는 것 같습니다. 내가 그것을 사용한 후에 그것을 삭제할 수 있도록 미리보기 경로를 어떻게 얻는 지 아이디어가 있습니까? 캡처 & 절약, 변수 및 활동이 저장
File mFile=new File(variable);
mfile.delete();
'경로'는 어디에서 왔습니까? – dotty
위 코드를 업데이트했습니다. – dotty