1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| try { CrashReport.UserStrategy strategy = new CrashReport.UserStrategy(this); strategy.setCrashHandleCallback(new CrashReport.CrashHandleCallback() { public Map onCrashHandleStart(int crashType, String errorType, String errorMessage, String errorStack) { LinkedHashMap map = new LinkedHashMap(); String x5CrashInfo = com.tencent.smtt.sdk.WebView.getCrashExtraMessage(GFApplication.this); map.put("x5crashInfo", x5CrashInfo); return map; } @Override public byte[] onCrashHandleStart2GetExtraDatas(int crashType, String errorType, String errorMessage, String errorStack) { try { return "Extra data.".getBytes("UTF-8"); } catch (Exception e) { return null; } } }); CrashReport.initCrashReport(this, "你的appID", false, strategy); } catch (Exception e) { e.printStackTrace(); }
|