0
如何獲取DateFormat MM-dd-yyyy hh:mm:ss來保存我的照片名稱?從文件中提取日期格式以附加到Android中的文件名
fileOutputStream = new FileOutputStream("/sdcard/CameraExample/" ...
如何獲取DateFormat MM-dd-yyyy hh:mm:ss來保存我的照片名稱?從文件中提取日期格式以附加到Android中的文件名
fileOutputStream = new FileOutputStream("/sdcard/CameraExample/" ...
Time t = new Time();
t.setToNow();
String session = t.format("%D %T")) //Strftime format
File f = Environment.getExternalStorageDirectory();
String fullfilename = f.getAbsoluteFile() + "/Android/data/Photos/" ;
File fileToWrite_data = new File(fullfilename,session + "_Data.txt");
FileOutputStream fos_data = new FileOutputStream(fileToWrite_data,true);
非常感謝,我的意思是不是從文件,遺憾的英語不好)。我做到了 - SimpleDateFormat sdf = new SimpleDateFormat(「dd」+「。」+「MM」+「。」+「yyyy」+「_」+「HH」+「 - 」+「mm」+「 - 」 「SS」); fileOutputStream = new FileOutputStream(「/ sdcard/CameraExample /」+ sdf.format(new Date())+「.bmp」); – Domos