I am having trouble in implementing databinding in a Dialog. Is it possible?
Below is my xml.
If you don't want to extend Dialog
, another possible solution could be:
Dialog dialog = new Dialog(this); // where "this" is the context
YourClassNameBinding binding = DataBindingUtil.inflate(dialog.getLayoutInflater(), R.layout.your_layout, null, false);
binding.setYourData(yourData);
dialog.setContentView(binding.getRoot());
dialog.show();
Hope it helps.