0
내 안드로이드 장치가 카메라에서 이미지를 저장할 디렉토리를 찾는 방법에 대한 지침을 제공 할 수 있습니까?Android : MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA
다음 코드 스 니펫에서 카메라 앱을 실행하기 전에 파일 목록을 가져 오려합니다. 카메라 앱에서 돌아 오면 같은 디렉토리에있는 모든 파일 목록을 가져 와서 새로 추가 된 파일을 처리합니다.
public void onBtnTakePhoto(final View view) {
existingfiles = UploadImageService.getFiles(<IMAGE_LOCATION>);
final Intent intent = new Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA);
startActivityForResult(intent, TAKE_PICTURE);
}
public void onActivityResult(final int requestCode, final int resultCode, final Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case TAKE_PICTURE:
List<String> newFies = UploadImageService.getFiles(<IMAGE_LOCATION>);
newFies.removeAll(existingfiles);
for (String newFile : newFies) {
File file = new File(newFile);
addImage(Uri.fromFile(file), PictureSource.CAMERA);
}
break;
}
// regardless of which activity, check that files exist:
verifyFilesExist(images);
}
@DigCamera, 감사의 말씀을 전합니다. David –
다행입니다. 건배! – DigCamara