美文网首页
android全局捕获异常的解决方法(一)

android全局捕获异常的解决方法(一)

作者: 宾哥来啦 | 来源:发表于2018-05-18 18:20 被阅读0次

调用部分:

在Application的onCreate()方法中调用下面三行代码:

Utils.init(getApplicationContext());

String dirPath = Environment.getExternalStorageDirectory().getAbsolutePath() +"/yobnMyAPP/log/";

CrashUtils.init(dirPath);

注意:Utils和CrashUtils使用都是开源代码:AndroidUtilCode,gradle引用:implementation'com.blankj:utilcode:1.15.1'

AndroidUtilCode的github地址:https://github.com/Blankj/AndroidUtilCode

相关文章

网友评论

      本文标题:android全局捕获异常的解决方法(一)

      本文链接:https://www.haomeiwen.com/subject/qqqndftx.html