From 78c4c455a8942e2874e9c28d7750380739d4ef49 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Thu, 27 Oct 2022 17:56:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=E5=8F=8D=E9=A6=88=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/com/shayu/phonelive/AppContext.java | 2 ++ .../main/java/com/shayu/phonelive/NeverCrashUtils.java | 1 + .../main/java/com/yunbao/common/bean/CrashSaveBean.java | 9 +++++++++ 3 files changed, 12 insertions(+) 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; + } }