I need to do a for loop in Kotlin:
for (setNum in 1..(savedExercisesMap[exerciseKey] as HashMap<*, *>)["sets"] as Int){
But I get this error:
java.lang.ClassCastException: java.lang.Double cannot be cast to java.lang.Integer
I wouldn't think this would be an issue. Is there a reason why this is happening and how to fix?
toInt()function, e.g.(savedExercisesMap[exerciseKey] as HashMap<*, *>)["sets"].toInt()savedExercisesMap,exerciseKeyetc.