How to update RecyclerView in Android
1) Insert single item at any position:String value = “India”;int index = 2;dataList.add(index, value);adapter.notifyItemInserted(index);This will add India at position 2.2) Insert multiple items:int index = 3;dataList.add(index,”Australia”);dataList.add(index,”England”);dataList.add(index,”South Africa”);adapter.notifyItemRangeInserted( index, dataList.size());Australia will be listed at position 3, England will be listed at position 4 and South Africa will be listed at position 53) Remove single item from any position:int […]
How to update RecyclerView in Android Read More »