title: how to pass data to MaterialAlertDialogBuilder in android
body: <p>I'm using latest material design library. Now to create a custom dialog I'm doing this</p>
  <pre><code>holder.id_edit_srt_bit.setOnClickListener {
              println(my_data[position])
              var data = my_data[position]
  
              MaterialAlertDialogBuilder(context)
                  .setView(R.layout.dialog_edit_form)
                  .setPositiveButton(&quot;OK&quot;) { dialog, which -&gt;
                      println(&quot;---------&gt; $dialog -&gt; $which&quot;)
                  }
                  .setNegativeButton(&quot;NO&quot;) { dialog, which -&gt;
                      println(&quot;---------&gt; $dialog -&gt; $which&quot;)
                  }
                  .show()
          }
  </code></pre>
  <p>on click it is opening the dialog with my custom layout <code>dialog_edit_form</code>. it has two text fields with <code>id1</code> and <code>id2</code>.</p>
  <p>now when opening this dialog i need to set a value which is in <code>data</code> variable</p>
  <p>how to do that ?</p>
  <p>i tried this but its not working</p>
  <pre><code>            var dialog = Dialog(context)
              dialog.findViewById&lt;EditText&gt;(R.id.id1)?.text = data?.val1 as Editable
              dialog.findViewById&lt;EditText&gt;(R.id.id2)?.text = data?.val2 as Editable
  </code></pre>
  <p>please answer in material design way only. I don't want older ways of doing it That's why i'm using <code>MaterialAlertDialogBuilder</code></p>