當我嘗試使用其最後修改日期重命名文件時,例如使用dateformat ="yyyy-MM-dd_HH;mm"
時它不起作用。Android SImpleDateFormat不適用於「yyyy -...」
當我使用:
dateformat = "dd-MM-yyyy_HH;mm;ss"
dateformat ="dd-MM-yyyy_HH;mm"
dateformat ="MM-dd-yyyy_HH;mm"
它完美,而是試圖用一年,第一個參數時,它不會重命名文件。
if (rb1.isChecked()) {
dateformat = "dd-MM-yyyy_HH;mm;ss";
} else if (rb2.isChecked()) {
dateformat = "dd-MM-yyyy_HH;mm";
} else if (rb3.isClickable()) {
dateformat = "MM-dd-yyyy_HH;mm";
} else if (rb3.isClickable()) {
dateformat = "yyyy-dd-MM_HH;mm";
} else if (rb4.isChecked()) {
dateformat = "yyyy-MM-dd_HH;mm";
}
else if (rb5.isChecked()) {
dateformat = new SimpleDateFormat("yyyy-dd-MM_HH;mm")
.format(new Date());
} else if (rb6.isChecked()) {
dateformat = new SimpleDateFormat("yyyy-MM-dd_HH;mm;ss")
.format(new Date());
}
我不應該使用.isCickable,但.isChecked .....
文件[]什麼類型的數組? –
Q.中的更多代碼 –
將代碼添加到一個很好的try catch(Exception e){Log.e(e.getClass()。getName(),e.getMessage(),e);}'''''''''''''例外,分享,解決方案必須快速! – Smile2Life