优化LiveUserMoreDialogFragment.activity强引用导致的内存泄漏

This commit is contained in:
zlzw 2022-12-05 17:39:32 +08:00
parent 84c89d7530
commit 98122c25d8
4 changed files with 2 additions and 5 deletions

View File

@ -289,6 +289,5 @@ public class Constants {
public static String isSetRemarkText = "";//修改的备注信息 public static String isSetRemarkText = "";//修改的备注信息
public static boolean isShowLiveDialog = false;//是否在直播间打开单聊 public static boolean isShowLiveDialog = false;//是否在直播间打开单聊
public static int firstInto = 0;// public static int firstInto = 0;//
public static long runTime = System.currentTimeMillis();
} }

View File

@ -1280,7 +1280,6 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
bundle.putBoolean("showBuyView", !showBuyView); bundle.putBoolean("showBuyView", !showBuyView);
fragment.setArguments(bundle); fragment.setArguments(bundle);
fragment.show(getSupportFragmentManager(), "LiveUserMoreDialogFragment"); fragment.show(getSupportFragmentManager(), "LiveUserMoreDialogFragment");
LiveUserMoreDialogFragment.activity = (LiveActivity) mContext;
outRankHideFirst = false; outRankHideFirst = false;
} }
@ -1302,7 +1301,6 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
bundle.putString("outRankHide", GsonUtils.toJson(outRankHide)); bundle.putString("outRankHide", GsonUtils.toJson(outRankHide));
fragment.setArguments(bundle); fragment.setArguments(bundle);
fragment.show(getSupportFragmentManager(), "LiveUserMoreDialogFragment"); fragment.show(getSupportFragmentManager(), "LiveUserMoreDialogFragment");
LiveUserMoreDialogFragment.activity = this;
} }

View File

@ -59,7 +59,6 @@ public class LiveUserMoreDialogFragment extends AbsDialogFragment implements Vie
private String mLiveUid; private String mLiveUid;
private String stream; private String stream;
private LiveGuardInfo mLiveGuardInfo; private LiveGuardInfo mLiveGuardInfo;
public static LiveActivity activity = null;
public eightbitlab.com.blurview.BlurView blurView; public eightbitlab.com.blurview.BlurView blurView;
public TextView audience_btn, guard_btn, fans_btn, tags, btn, gz_view, dayRank, weekRank, title; public TextView audience_btn, guard_btn, fans_btn, tags, btn, gz_view, dayRank, weekRank, title;

View File

@ -34,6 +34,7 @@ import com.tencent.live2.V2TXLivePlayerObserver;
import com.tencent.live2.impl.V2TXLivePlayerImpl; import com.tencent.live2.impl.V2TXLivePlayerImpl;
import com.tencent.rtmp.ui.TXCloudVideoView; import com.tencent.rtmp.ui.TXCloudVideoView;
import com.yunbao.common.Constants; import com.yunbao.common.Constants;
import com.yunbao.common.bean.CrashSaveBean;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.HttpClient; import com.yunbao.common.http.HttpClient;
import com.yunbao.common.utils.DeviceUtils; import com.yunbao.common.utils.DeviceUtils;
@ -360,7 +361,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
"剩余内存:" + DeviceUtils.getMemory(mContext) + "\n" + "剩余内存:" + DeviceUtils.getMemory(mContext) + "\n" +
"分辨率:" + statistics.height + "x" + statistics.width + "\n" + "分辨率:" + statistics.height + "x" + statistics.width + "\n" +
"播放状态:" + mPlayer.isPlaying() + "\n" + "播放状态:" + mPlayer.isPlaying() + "\n" +
"运行时间:" + (System.currentTimeMillis()- Constants.runTime)/1000 + "\n"; "运行时间:" + (System.currentTimeMillis()- CrashSaveBean.getInstance().getStartTime())/1000 + "\n";
debugView.setText(debugText); debugView.setText(debugText);
Log.i(TAG, "onStatisticsUpdate: " + JSON.toJSONString(statistics) + " |当前下载数 : " + OkDownload.getInstance().getTaskMap().size() + buffer); Log.i(TAG, "onStatisticsUpdate: " + JSON.toJSONString(statistics) + " |当前下载数 : " + OkDownload.getInstance().getTaskMap().size() + buffer);
if (statistics.height > statistics.width) { if (statistics.height > statistics.width) {