I am a Kotlin beginner. I have a mutable list which have some items, I want to add one new item to 0th index, but my list have already an item at 0th position which I want to move to 1st index. Right now my code is adding the item but the previous item is getting lost.
var list :MutableList<Food> = mutableListOf()
list.set(0,setItem)
fun setItem: Food{
val food = Foood("Select", -1, "Dessert", "" )
return food
}