I want to set new items to top of recyclerview. But when I set items, recyclerview scroll to top automatically.
I tried many codes but I can't resolve that.
here is my addItem method:
public void addItem(final ArrayList<String> list) { for (int i=0; i< list.size();i++){ items.add(i,list.get(i)); } activity.runOnUiThread(new Runnable() { @Override public void run() { // notifyDataSetChanged(); // notifyItemRangeInserted( 0,list.size() ); // notifyItemInserted(); notifyItemRangeInserted(10,11); // notifyDataSetChanged(); } }); } I tried all of commented method.
could you please help me to resolve this??
Thanks