【发布时间】:2014-01-29 10:19:11
【问题描述】:
此相机意图是否将文件保存到 imageUri?我从这里获取此代码:How to take a photo, save it and get the photo in Android
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
imageUri = Uri.fromFile(new File(Environment.getExternalStorageDirectory(),
"fname_" + String.valueOf(System.currentTimeMillis()) + ".jpg"));
intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, imageUri);
startActivityForResult(intent, CAMERA_REQUEST);
在 onActivityResult()...
else if ((requestCode == CAMERA_REQUEST) && (resultcode == -1)) {
Uri selectedImage = imageUri;
mProfilePicPath = selectedImage.toString();
mPortraitPhoto = ih.decodeSampledBitmapFromImagePath(mProfilePicPath,
GlobalConstants.PROFILE_PICTURE_RESOLUTION,
GlobalConstants.PROFILE_PICTURE_RESOLUTION);
mProfilePicPath 不是有效的文件路径(未找到)。
【问题讨论】:
标签: android android-intent camera filenotfoundexception