房间消息提醒弹窗显示逻辑优化

This commit is contained in:
huangjian
2022-01-18 17:25:03 +08:00
parent ec6bd56415
commit 8264fe6e38

View File

@@ -368,7 +368,8 @@ public class BottomView extends FrameLayout implements View.OnClickListener {
}
private void showMsgPopup(View parent, RecentContact recentContact) {
if (parent == null || recentContact == null || recentContact.getUnreadCount() == 0) return;
if (parent == null || recentContact == null || recentContact.getUnreadCount() == 0 || !isAttachedToWindow())
return;
if (getContext() instanceof Activity && ((Activity) getContext()).isFinishing()) return;
UserInfo userInfo = NimUIKit.getUserInfoProvider().getUserInfo(recentContact.getFromAccount());