title: DataBinding With Android Dialog
body: <p>I have implemented <code>DataBinding</code> in <code>Activity</code>, <code>Fragment</code> and <code>RecyclerView</code>. Now trying to do it in <code>Dialog</code>, but little bit confuse about how to set custom view inside it?</p>
  
  <p>Here is code i have implemented for <code>Dialog</code>.</p>
  
  <pre><code>Dialog dialog = new Dialog(context);
  dialog.getWindow();
  
  dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
  dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
  
  LayoutTermsBinding termsBinding;
  
  dialog.setContentView(R.layout.layout_terms);
  dialog.getWindow().setLayout(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
  
  dialog.show();
  </code></pre>
  
  <p>I know if it is <code>Activity</code> we can perform <code>DataBindingUtil.setContentView()</code> and for <code>Fragment</code> we can perform <code>DataBindingUtil.inflate()</code> but i am confuse about how to convert <code>dialog.setContentView(R.layout.layout_terms);</code> with <code>DataBinding</code>.</p>