/** @Description: 从拍照获取 */ private void getPicFromCamera() { imagePath = FileUtils.getImagePath(); File f = new File(imagePath); if (f.exists()) { f.delete(); } try { f.createNewFile(); } catch (IOException e) { e.printStackTrace(); } Uri uri = Uri.fromFile(f); Intent camera = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); camera.putExtra(MediaStore.EXTRA_OUTPUT, uri); startActivityForResult(camera, CommonConstant.REQUESTCODE_PHOTO_CAMERA); }