Nurseyit Tursunkulov
Nurseyit Tursunkulov

Reputation: 9380

How to add several string values to textView with databinding?

I want to do like this:

 android:text="@{task.price, task.date, task.owner}"

(not with the binding adapter)

Upvotes: 1

Views: 86

Answers (1)

S. Gissel
S. Gissel

Reputation: 2650

This will work:

android:text="@{task.price.concat(task.date).concat(task.owner).concat(@string/myCustomText)}"

This also:

<data>
    <import type="String" />
</data>
<TextView
    android:text="@{String.format(task.price, task.date, task.owner)}" />

Upvotes: 1

Related Questions