Sudhir Singh Khanger
10/25/2018, 5:51 PMCHEESE_DATA.map { Cheese(id = 0, name = it) }
CHEESE_DATA
is an ArrayList. If we apply map
with the above function then should it not create a list of Cheese objects with id 0
and name it
. The result seems to be Cheese object with an incremented value for id and it
name. What am I missing?
https://github.com/googlesamples/android-architecture-components/blob/6248bed977e7a82d6f3199e8a940a39b7d6f051c/PagingSample/app/src/main/java/paging/android/example/com/pagingsample/CheeseDb.kt#L54Andreas Sinz
10/25/2018, 5:54 PMluke
10/25/2018, 5:54 PMSudhir Singh Khanger
10/25/2018, 6:06 PMAndreas Sinz
10/25/2018, 7:00 PMmap
doesn't change id
, room does itSudhir Singh Khanger
10/25/2018, 7:03 PM