W/RecyclerView: Cannot call this method in a scroll callback. Scroll callbacks mightbe run during a measure & layout pass where you cannot change theRecyclerView data. Any method call that might change the structureof the RecyclerView or the adapter contents should be postponed tothe next frame.
java.lang.IllegalStateException: androidx.recyclerview.widget.RecyclerView{bcfafdd VFED..... ......ID 0,0-340,640 #7f0a0146 app:id/recyclerView}, adapter:com.example.getcontents.adapter.RecyclerViewAdapter@f16752, layout:androidx.recyclerview.widget.LinearLayoutManager@fb02a23, context:com.example.getcontents.activity.ContentsListActivity@7fec6f9
스크롤 콜백에서 이 메서드를 호출할 수 없습니다. 스크롤 콜백은 RecyclerView 데이터를 변경할 수 없는 측정 및 레이아웃 단계에서 실행될 수 있습니다. RecyclerView 또는 어댑터 내용의 구조를 변경할 수 있는 모든 메서드 호출은 다음 프레임으로 연기되어야 함.
val runnable = Runnable {
items.add(null)
mListAdapter.notifyItemInserted(items.size -1)
}
mRecyclerView.post(runnable)