基本上,我只想知道是否可以将通过相机意图拍摄的图像的日期保存到Image_01Jan2015.jpg而不是Image_20150101?
这是我的代码,但是想知道是否可以像Image_01Jan2015一样保存它?
Intent imageIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
File imagesFolder = new File(Environment.getExternalStorageDirectory(), "My Images");
imagesFolder.mkdirs();
image = new File(imagesFolder.getPath(), "Image_" + timeStamp + ".jpg");
fileUri = Uri.fromFile(image);
谢谢
您需要将dateformat更改为
timeStamp = new SimpleDateFormat("yyyyMMyyyy_HHmmss").format(new Date());
到
timeStamp = new SimpleDateFormat("ddMMMyyyy").format(new Date());
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句