0
這是我如何從應用程序日誌:的Java的Android獲取日誌文件
try {
SimpleDateFormat sdf = new SimpleDateFormat(
"yyyy-MM-dd", Locale.US);
String currentDateandTime = sdf.format(new Date());
final File path = new File(Environment.getExternalStorageDirectory(), "SMOK_komunal");
if (!path.exists()) {
path.mkdir();
}
Log.e("path ", path.getAbsolutePath());
Runtime.getRuntime().exec("logcat -f " + path + File.separator + "dbo_logcat_" + currentDateandTime + ".txt");
} catch (IOException e) {
e.printStackTrace();
}
但在這個日誌我沒有在線路如何添加日期和時間的日期和時間?