perfusionIndexValue.postValue(
list.lastOrNull()?.perfusionIndex?.takeIf {
it != PerfusionIndex.NO_DATA
}?.value?.toString().orEmpty() + " %"
)
< /code>
Но если я сделаю это с ресурсами: < /p>
perfusionIndexValue.postValue(
list.lastOrNull()?.perfusionIndex?.takeIf {
it != PerfusionIndex.NO_DATA
}?.value?.toString().orEmpty() + Resources.getSystem().getString(R.string.pi_percent)
)
< /code>
Я получаю < /p>
io.reactivex.rxjava3.exceptions.UndeliverableException: The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | android.content.res.Resources$NotFoundException: String resource ID #0x7f0e0081
Мне нужно показать ценность в процентах в Textview, например, «15 %» Я делаю это в ViewModel таким образом, и это работает: < /p> [code] perfusionIndexValue.postValue( list.lastOrNull()?.perfusionIndex?.takeIf { it != PerfusionIndex.NO_DATA }?.value?.toString().orEmpty() + " %" ) < /code> Но если я сделаю это с ресурсами: < /p> perfusionIndexValue.postValue( list.lastOrNull()?.perfusionIndex?.takeIf { it != PerfusionIndex.NO_DATA }?.value?.toString().orEmpty() + Resources.getSystem().getString(R.string.pi_percent) ) < /code> Я получаю < /p> io.reactivex.rxjava3.exceptions.UndeliverableException: The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | android.content.res.Resources$NotFoundException: String resource ID #0x7f0e0081 [/code] Как я могу установить текст как «15 %»