现在的位置: 首页 > 综合 > 正文

Android 打印堆栈

2018年01月18日 ⁄ 综合 ⁄ 共 253字 ⁄ 字号 评论关闭

Android 打印堆栈信息的方法:

1:

RuntimeException re = new RuntimeException();
re.fillInStackTrace();
Log.e("info", "info", re);

2:    
  1. Log.w(TAG, Log.getStackTraceString(new Throwable()));
3:
  1. try {
  2. catch (InterruptedException e) {
  3.     Log.e(TAG, Log.getStackTraceString(e));  
  4. }  

抱歉!评论已关闭.