Код: Выделить всё
val secondScreenResult = navHostController.currentBackStackEntry
?.savedStateHandle
?.getLiveData("selectedPosition")?.observeAsState()
secondScreenResult?.value?.let {
// Read the result
val pos = it.toInt()
}
Код: Выделить всё
java.lang.NumberFormatException: For input string: "MutableState(value=1)@196947123"
Подробнее здесь: https://stackoverflow.com/questions/785 ... ing-to-int