diff --git a/app/src/main/java/com/shayu/phonelive/AppContext.java b/app/src/main/java/com/shayu/phonelive/AppContext.java index d8b08e0e9..a2c30e01c 100644 --- a/app/src/main/java/com/shayu/phonelive/AppContext.java +++ b/app/src/main/java/com/shayu/phonelive/AppContext.java @@ -117,6 +117,7 @@ public class AppContext extends CommonAppContext { @Override public void onActivityCreated(@NonNull Activity activity, @Nullable Bundle savedInstanceState) { activities.add(new WeakReference<>(activity)); + CrashSaveBean.getInstance().setActivitySize(activities.size()); } @Override @@ -358,5 +359,6 @@ public class AppContext extends CommonAppContext { FirebaseCrashlytics.getInstance().setCustomKey("enterRoom", CrashSaveBean.getInstance().getEnterRoom()); FirebaseCrashlytics.getInstance().setCustomKey("slidingRoom", CrashSaveBean.getInstance().getSlidingRoom()); FirebaseCrashlytics.getInstance().setCustomKey("playSvga", CrashSaveBean.getInstance().getPlaySvga()); + FirebaseCrashlytics.getInstance().setCustomKey("ActivitySize", CrashSaveBean.getInstance().getActivitySize()); } } diff --git a/app/src/main/java/com/shayu/phonelive/NeverCrashUtils.java b/app/src/main/java/com/shayu/phonelive/NeverCrashUtils.java index 78cf7245d..f99f3a492 100644 --- a/app/src/main/java/com/shayu/phonelive/NeverCrashUtils.java +++ b/app/src/main/java/com/shayu/phonelive/NeverCrashUtils.java @@ -143,6 +143,7 @@ public class NeverCrashUtils { writer.write("enterRoom=" + CrashSaveBean.getInstance().getEnterRoom()+ "\n"); writer.write("slidingRoom=" + CrashSaveBean.getInstance().getSlidingRoom()+ "\n"); writer.write("playSvga=" + CrashSaveBean.getInstance().getPlaySvga()+ "\n"); + writer.write("ActivitySize=" + CrashSaveBean.getInstance().getActivitySize()+ "\n"); writer.write("UserData=" + SpUtil.getInstance().getStringValue(SpUtil.USER_INFO) + "\n"); writer.write("[ERROR]"); PrintWriter printWriter = new PrintWriter(writer); diff --git a/common/src/main/java/com/yunbao/common/bean/CrashSaveBean.java b/common/src/main/java/com/yunbao/common/bean/CrashSaveBean.java index 6f7036836..c6a0bb684 100644 --- a/common/src/main/java/com/yunbao/common/bean/CrashSaveBean.java +++ b/common/src/main/java/com/yunbao/common/bean/CrashSaveBean.java @@ -9,6 +9,7 @@ public class CrashSaveBean { private long enterRoom;//进入房间次数 private long slidingRoom;//滑动直播间次数 private long playSvga;//加载播放svga次数 + private long activitySize;//Activity数量 private CrashSaveBean() { @@ -52,5 +53,13 @@ public class CrashSaveBean { public void addSlidingRoom() { slidingRoom++; } + + public long getActivitySize() { + return activitySize; + } + + public void setActivitySize(long activitySize) { + this.activitySize = activitySize; + } }