728x90 R1 viewmodel에서 R.string 처리하기 viewmodel에서 livedata(Int)를 통해 R.string값을 데이터 바인딩 하여 xml에서 context.getString(해당하는 값) 이런식으로 사용하면 된다. ex) viewmodel) val textResource = MutableLivdata(R.string.hello) layout) android:text="@{context.getString(viewModel.textResource)}" 참고 https://leesmemo.tistory.com/21 2023. 3. 10. 이전 1 다음 728x90