【发布时间】:2019-10-12 06:40:04
【问题描述】:
我正在根据文档保存一张全尺寸照片。 https://developer.android.com/training/camera/photobasics#TaskPath
private File createImageFile() throws IOException {
// Create an image file name
File storageDir = getExternalFilesDir("TestImageCapture");
String timeStamp = new SimpleDateFormat("yyyyMMdd").format(new Date());
String imageFileName = "JPEG_" + timeStamp + "_";
File image = File.createTempFile(
imageFileName, /* prefix */
".jpg", /* suffix */
storageDir /* directory */
);
String currentPhotoPath = image.getAbsolutePath();
return image;
}
根据我的代码,它应该保存名为:JPEG_20191012_.jpg 的图像,但它保存的是 JPEG_20191012_200766502860978687.jpg 为什么我最后会得到这么长的数字。我怎样才能摆脱它?
【问题讨论】: