前几次更新有效但是到第四次左右就无效了不知道为什么,所有数据两百多条,只能加载出四五条。代码如下:
if (photoDAO!=null) {
pojoList.add(photoDAO);
titleCount.setText(String.valueOf(pojoList.size()));
if (pojoList.size() <= 1) {
ScanAdapter scanAdapter = new ScanAdapter(Scan.this, pojoList, handler, CHECK_ALL_SUCCESS_FLAG);
gridView.setAdapter(scanAdapter);
allCheckBox.setOnClickListener(v -> {
gridView.setAdapter(scanAdapter.setChecked(allCheckBox.isChecked()));
});
LogUtil.debug("刷新适配器 size:"+pojoList.size());
}else {
gridView.deferNotifyDataSetChanged();
LogUtil.debug("通知更新 size:"+pojoList.size());
}
}