private String getFilename() {
String filepath = Environment.getExternalStorageDirectory().getPath();
File file = new File(filepath, AUDIO_RECORDER_FOLDER);
if (!file.exists()) {
file.mkdirs();
}
return (file.getAbsolutePath() + "/" + System.currentTimeMillis() + file_exts[currentFormat]);
}
我想用當前日期和時間格式保存我的文件,因爲我的錄製文件未使用當前日期和時間格式進行保存。如何使用當前日期和時間格式保存錄音機音頻
您已成功保存了文件,但該文件的名稱是不喜歡你想要的(當前日期和時間格式) , 對? –
是的,我想用當前的日期和時間格式保存我的文件。 –
使用'SimpleDateFormat'。這裏有一些例子http://stackoverflow.com/questions/6406470/java-simpledateformat – nandsito