在android中camera捕捉相片后 相片的存放是手机程序执行的他会自己捕捉与存取并放到一个权限比较低的地方,当你想把这个存放到你这个应用程序中时他是没有权限的,因此必须通过复制自带程序存放的图片到自己的应用程序中。
private void saveFullImage() {
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
File file = new File(Environment.getExternalStorageDirectory(), "test.jpg");
outputFileUri = Uri.fromFile(file);
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
startActivityForResult(intent, TAKE_PICTURE);}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{ if ((requestCode == TAKE_PICTURE) && (resultCode == Activity.RESULT_OK)) { // Check if the result includes a thumbnail Bitmap
if (data == null) {
// TODO Do something with the full image stored
// in outputFileUri. Perhaps copying it to the app folder
}
}
}