I would like to store information such as rowid (key) and orderId (value) in MutableMap. Then iterate through the MutableMap and get the current item key and value and the next item key and value. The reason for that is that while I am iterating through the Map I am changing the value of the first item using the second item value or I am changing the value of the second item value using the first item value.
Example:
val mutableMap: MutableMap<Int, Int> = mutableMapOf<Int, Int>()
mutableMap[350] = 0
mutableMap[351] = 1
mutableMap[352] = 2
mutableMap[353] = 3
mutableMap.put(354, 4)
mutableMap.put(355, 5)
mutableMap.put(356, 6)
for (key in mutableMap.keys) {
Log.d("print data", "print data, Key = ${key}, Value = ${mutableMap[key]}")
}
How to get this item: myLinkedHashMap[450] = 0 and this item myLinkedHashMap[453] = 3 information at the same time so I can swap the value between them ?