我想使用默認相機和捕捉圖像。我想保存圖像中的SD卡/ photofolder /和保存文件名,如SD卡/ photofolder /也顯示在imageview的頁面捕獲圖像如何在SD卡中保存捕獲圖像?
Uri outputFileUri = Uri.fromFile("/sdcard/Photofolder/");
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
startActivityForResult(intent, CAMERA_REQUEST);
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == CAMERA_REQUEST) {
Bitmap photo = (Bitmap) data.getExtras().get("data");
// imageView.setImageBitmap(photo);
BitmapFactory.Options options = new BitmapFactory.Options();
options.inSampleSize = 4;
Bitmap bitmap = BitmapFactory.decodeFile(picFileName, options);
imageView.setImageBitmap(bitmap);
imageView.setVisibility(View.VISIBLE);
}
}
任何想法,這個curenttime格式?感謝adavance
** outputFileUri **的值是多少? – user370305
從這個問題找到答案http://stackoverflow.com/questions/12179045/how-to-access-an-image-that-is-stored-internally/12179239#12179239 .. – user370305
聰明...看看我的以上評論..你在OP的問題的答案... – user370305