我很好奇printStackTrace()和toString()之间的区别.乍一看,他们似乎完全一样.
码:
try {
// Some code
} catch (Exception e)
e.printStackTrace();
// OR
e.toString()
}
Run Code Online (Sandbox Code Playgroud) 我的程序在设备中崩溃了.我希望在我的设备中运行时准确捕获我的程序日志.我想将日志写入我的SD卡,直至崩溃.我怎样才能做到这一点?