use of com.liangfeizc.databinding.databinding.ViewStubBinding in project MasteringAndroidDataBinding by LyndonChin.
the class ViewStubActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mBinding = DataBindingUtil.setContentView(this, R.layout.activity_view_stub);
mBinding.viewStub.setOnInflateListener(new ViewStub.OnInflateListener() {
@Override
public void onInflate(ViewStub stub, View inflated) {
ViewStubBinding binding = DataBindingUtil.bind(inflated);
User user = new User("liang", "fei");
binding.setUser(user);
}
});
}
Aggregations