Here is a simple ArrayList:
private val fruits = arrayListOf(
FruitsInBox("Apple", "Korea", "2ea"),
FruitsInBox("Mango", "India", "1ea"),
FruitsInBox("Strawberry", "Australia", "1ea"),
FruitsInBox("Kiwi", "NewZealand", "2ea"),
FruitsInBox("Peach", "Korea", "3ea")
)
And, I want to filter the data by the number of fruits, like below.
private var numberOfFruits = arrayOf("All", "1ea", "2ea", "3ea", "4ea")
However, I hope to put the things "All", "1ea", "2ea", "3ea", "4ea" from the ArrayList, automatically.
Do you have any idea?
FruitsInBox? You have tomapandfilterby the attribute that holds those values.