2

I have a fragment with ViewModel and a string resource like this

<string name="money_format">Money: %1$d</string>

In ViewModel I have MutableLivaData money. How I can set in fragment's XMLfile a text property to money_format with parameter Money from viewModel

1 Answer 1

2

It'll look like this

android:text="@{@string/money_format(viewModel.money)}"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.