您的位置:首页 > 其它

关于cannot call this method while recyclerview is computing a layout or scrollin

2017-07-31 17:47 525 查看
不要在R ecycleview的bindviewholder里面设置的点击事件里面直接刷新数据

可以通过接口回调或者通知到外部去调用刷新

类似Evenbus完美解决

如果按照网上开ui线程去刷新,我觉得处理起来消耗的内存更多

性能方面没那么好

不知道对不对

public void onEvent(ResumeEven e){
if (e.getP()!=e.getPosition())
rightAdapter.notifyDataSetChanged();
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  安卓 性能 recycleview
相关文章推荐