デフォルトのカメラを使用して画像をキャプチャしたい。画像をsdcard/photofolder /に保存し、ファイル名を現在の形式でsdcard / photofolder /に保存し、キャプチャ画像をimageviewページに表示したい
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);
}
}
これについて何か考えはありますか?前進してくれてありがとう