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 index = 4;dataList.remove( index);adapter.notifyItemRemoved(index);This will remove England from the RecyclerView.4) Remove multiple items:int startIndex = 2;int endIndex = 4;int count = endIndex – startIndex;dataList.subList(startIndex, endIndex).clear();adapter.notifyItemRangeRemoved(startIndex, count);This will remove 2 items at position 2 and 3.5) Remove all items:dataList.clear();adapter.notifyDataSetChanged();6) Replace old list with new list:dataList.clear();// add new listArrayList newList = new ArrayList();newList.add(“Sri Lanka”);newList.add(“Bangladesh”);newList.add(“Pakistan”);dataList.addAll(newList);// notify adapteradapter.notifyDataSetChanged();This will replace the old values with new one.7) Update single item:String newValue = “India”;int updateIndex = 2;dataList.set(updateIndex, newValue);adapter.notifyItemChanged(updateIndex);This is replace Pakistan with India8) Change position of a single item:int fromPosition = 2;int toPosition = 0;// update data arrayString item = dataList.get(fromPosition);dataList.remove(fromPosition);dataList.add(toPosition, item);// notify adapteradapter.notifyItemMoved(fromPosition, toPosition);This will move India from Postion 3 to 0. This are the various ways you can update recyclerview
How to update RecyclerView in Android
We're Ready, Let's Talk
Top SEO Trends To Follow In 2022-23
web idea solution
September 15, 2022

Top 5 Must-Have Features for Your E-Commerce Website in 2025
Rakesh
January 27, 2025

I Want to Make a Mobile App for My Business – Where Do I Start?
web idea solution
May 26, 2025

Major Differences Between Ionic Vs React Native
admin
June 29, 2020

Krea AI: The Future of Image Creation is Here (and It’s Easier Than You Think!)
web idea solution
July 4, 2024