源码中把11111这一行移到22222这一行,在数据源为空的时候才能重新刷新数据.
Opened this issue · 0 comments
Mr-jinPH commented
private void drawLayout() {
22222222222222 this.removeAllViews();
if (mAdapter == null || mAdapter.getCount() == 0) {
return;
}
1111111111111// this.removeAllViews();
for (int i = 0; i < mAdapter.getCount(); i++) {
View view = mAdapter.getView(i,null,null);
final int position = i;
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (mListener != null) {
mListener.itemClick(position);
}
}
});
this.addView(view);
}
}