var color by rememberSaveable { mutableStateOf(Color.Red) }
< /code>
java.lang.IllegalArgumentException: MutableState containing Color(1.0, 0.0, 0.0, 1.0, sRGB IEC61966-2.1) cannot be saved using the current SaveableStateRegistry. The default implementation only supports types which can be stored inside the Bundle. Please consider implementing a custom Saver for this class and pass it as a stateSaver parameter to rememberSaveable().
< /code>
How to implement Saver
Я хочу сохранить цвет после вращения экрана. Но этот код бросает ошибку: < /p> [code]var color by rememberSaveable { mutableStateOf(Color.Red) } < /code> java.lang.IllegalArgumentException: MutableState containing Color(1.0, 0.0, 0.0, 1.0, sRGB IEC61966-2.1) cannot be saved using the current SaveableStateRegistry. The default implementation only supports types which can be stored inside the Bundle. Please consider implementing a custom Saver for this class and pass it as a stateSaver parameter to rememberSaveable(). < /code> How to implement Saver[/code] для цвета ?