github项目CrashCustomActivity感谢作者做出的贡献。
1、添加依赖库:
dependencies {
compile 'cat.ereza:customactivityoncrash:1.5.0'
}
2、重写Application,在AndroidManifest中配置的Application类。在Application的onCreate方法中进行如下操作:
@Override
public void onCreate() {
super.onCreate();
CustomActivityOnCrash.install(this);
}
3、在项目中添加一个按钮,点击按钮时候做1/0操作,逻辑简单不上代码了
点击button时候应该闪退,现在是出现
点击Error details时候可以看到错误日志
这样测试时候看到错误日志,是不是很方便。