recyclerview的子view中有checkbox的时候,报Cannot call this method while RecyclerView is computing a layout or scrolling异常,我的解决办法是:调notifyDataSetChanged()方法的时候,将该方法放入线程中
recyclerView.post(new Runnable() { @Override public void run() { analyzeRecordAdapyer.notifyDataSetChanged(); } });
也有高人对这个问题进行了深度分析: