diff --git a/app/src/main/java/com/shayu/phonelive/AppContext.java b/app/src/main/java/com/shayu/phonelive/AppContext.java index a2c30e01c..ba2f78824 100644 --- a/app/src/main/java/com/shayu/phonelive/AppContext.java +++ b/app/src/main/java/com/shayu/phonelive/AppContext.java @@ -117,7 +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()); + CrashSaveBean.getInstance().setActivitySize(activities); } @Override 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 c6a0bb684..d29298124 100644 --- a/common/src/main/java/com/yunbao/common/bean/CrashSaveBean.java +++ b/common/src/main/java/com/yunbao/common/bean/CrashSaveBean.java @@ -1,5 +1,10 @@ package com.yunbao.common.bean; +import android.app.Activity; + +import java.lang.ref.WeakReference; +import java.util.List; + /** * 用于统计记录崩溃的数据 */ @@ -9,7 +14,7 @@ public class CrashSaveBean { private long enterRoom;//进入房间次数 private long slidingRoom;//滑动直播间次数 private long playSvga;//加载播放svga次数 - private long activitySize;//Activity数量 + private List> activities;//Activity数量 private CrashSaveBean() { @@ -54,12 +59,18 @@ public class CrashSaveBean { slidingRoom++; } - public long getActivitySize() { - return activitySize; + public String getActivitySize() { + StringBuilder builder=new StringBuilder(); + for (WeakReference activity : activities) { + if(activity.get()!=null){ + builder.append(activity.get()).append(","); + } + } + return builder.toString(); } - public void setActivitySize(long activitySize) { - this.activitySize = activitySize; + public void setActivitySize(List> activitySize) { + this.activities = activitySize; } }