I have a ArrayList of model class with some items in it. How to add new item to first position of ArrayList and shift others next to it.
ArrayList
You can use this method.
arraylist .add(0, object)
AbstractList declares the following:
public void add(int location, E object)
So,
myArrayList.add(0, myObject);
Would add it an the top of the list.
You can use this method.