where I scroll RecyclerView got problem on this code
this one from RecyclerView.Adapter
return items.get(position) != null ? VIEW_ITEM : VIEW_PROG;
and this one from activity
lLayout = new GridLayoutManager(MyActivity.this, 2);
rView.setVisibility(View.VISIBLE);
rView.setHasFixedSize(true);
rView.setLayoutManager(lLayout);
lLayout.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
switch(rcAdapter.getItemViewType(position)){
case RecyclerViewAdapter.VIEW_ITEM:
return 1;
case RecyclerViewAdapter.VIEW_PROG:
return 2;
default:
return -1;
}
}
});
Got Exception :
java.lang.IndexOutOfBoundsException: Invalid index 49, size is 0 java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
help me how to fixed this thank you