tencentyun / MLVBSDK

移动直播 SDK,国内下载镜像:
https://cloud.tencent.com/document/product/454/7873
775 stars 917 forks source link

【Android】-【6.8.7969】【TCUserAvatarListAdapter 当观众快速增加时报错IndexOutOfBoundsException】 #66

Closed sufaith closed 4 years ago

sufaith commented 4 years ago

【当前现象】 直播过程中,当观众数快速增加时,观众列表TCUserAvatarListAdapter崩溃

java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid view holder adapter positionViewHolder{9e582e1 position=50 id=-1, oldPos=48, pLpos:48 scrap [attachedScrap] tmpDetached not recyclable(1) no parent} android.support.v7.widget.RecyclerView

【集成包】 专业版Professional

【流id或url】 1234_test

【问题时间段】 人数快速增加时必现

【机型】安卓

【之前版本有无此问题】 一直有

【复现概率】 必现

【复现途径】

  1. 多线程模拟人数进入直播间
  2. 出现 Bug

【Demo 复现途径】

  1. 多线程模拟人数进入直播间
  2. 出现 Bug

【相关附件】

demo源码中的以下代码有问题:

    mUserAvatarList.add(0, userInfo);
    //超出时删除末尾项
    if(mUserAvatarList.size() > TOP_STORGE_MEMBER) {
        mUserAvatarList.remove(TOP_STORGE_MEMBER);
        notifyItemRemoved(TOP_STORGE_MEMBER);
    }
    notifyItemInserted(0);
whalehe commented 4 years ago

您好,可以更新下我们最新版本7.4,如果还有问题,烦请附上日志或者截图信息。