Здравствуйте, решений на просторах нашел много, но не могу понять, что я сделал не так, Вроде должно работать.
Фото делается и на карточку сохраняется.
private void takePicture() {
Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
File photoFile = new File(Environment.getExternalStorageDirectory(), StartMenuActivity.DIR_NAME + "/" + travelDirName
+ "/" + travelDirName + "_" + poisArray.size() + ".jpg");
cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photoFile));
imageOrVideoUri = Uri.fromFile(photoFile);
startActivityForResult(cameraIntent, CAMERA_REQUEST_PICTURE);
}
private void takeVideo() {
Intent cameraIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
File videoFile = new File(Environment.getExternalStorageDirectory(), StartMenuActivity.DIR_NAME + "/" + travelDirName
+ "/" + travelDirName + "_" + poisArray.size() + ".mp4");
cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(videoFile));
imageOrVideoUri = Uri.fromFile(videoFile);
startActivityForResult(cameraIntent, CAMERA_REQUEST_VIDEO);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
//super.onActivityResult(requestCode, resultCode, data);
if ((resultCode == RESULT_OK)&&(data != null)) {
if (requestCode == CAMERA_REQUEST_PICTURE) {
createThumbnail();
addPoi(PICTURE_POI);
}
if (requestCode == CAMERA_REQUEST_VIDEO) {
addPoi(VIDEO_POI);
}
} else {
Toast.makeText(TravelMapActivity.this, R.string.poi_add_error, Toast.LENGTH_LONG).show();
}
}
Спасибо.