Nate Ebel
1 min readMay 19, 2018

--

Marlon López you can use DataBinding in a similar way by exposing resource ids on your viewmodels, and then binding those in the layout xml. You can avoid requiring a Context in your viewmodel this way.

For example:

class UserViewModel {    ObservableInt nameLabelResId = new ObservableInt(R.string.label_name);}

You could then modify the resource id by the viewmodel’s controlling logic

--

--

Nate Ebel
Nate Ebel

Written by Nate Ebel

Building great software and helping others do the same.

No responses yet