我在使用相机的 android 开发人员的资源时遇到问题,这是我的代码:
// create Intent to take a picture and return control to the calling application
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE);
// create a file to save the image
intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri); // set the image file name
// start the image capture Intent
startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);
问题是“MEDIA_TYPE_IMAGE”,它表示它无法解析为变量。我将媒体商店、相机和 URI 导入到我的项目中。提前致谢!