07/05/2022, 3:51 PM
loop showing only 2 elements out of 10 after a live data observation I am listening to an emit from a live data and want to loop through the list to Log them. if I do myList.toString(), I can see all 10 elements of the list. But my loop stops after logging two elements: myLiveData.observe(this, Observer { val items : List = it Log.i("TAG", "${items.toString()}") // shows all 10 items correctly //log each item for(i: Item in items){ Log.i("TAG", i.code) } // above loop shows the first two items only....