我想将相机拍摄的图像存储到SD卡中我的特定文件夹中,并带有捕获的日期和时间。 代码是
if (requestCode == CAMERA_REQUEST) {
Bitmap photo = (Bitmap) data.getExtras().get("data");
if (photo != null) {
imageView.setImageBitmap(photo);
}
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss", Locale.ENGLISH);
String strCurDate = dateFormat.format(new Date(System.currentTimeMillis()));
String imageName = "" + strCurDate + ".jpg";
Bundle imgData = new Bundle();
imgData.putString("IMAGENAME", imageName);
这里的问题是因为日期格式在日期和时间之间有空格(yyyy-MM-dd hh:mm:ss),我无法在SD卡中存储具有指定日期格式的图像。
有什么建议吗?