I know that it is possible to reference resources in layout by their resource id:
android:text=\"@{@string/resourceName}\"
However, I would
You can use:
android:text='@{(id > 0) ? context.getString(id) : ""}'