title: How to set custom button in custom dialog box?
body: <p>My dialog box is a custom layout dialogbox_solution with one title and two buttons. 
  Here is XML file with only main lines :</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
      &lt;RelativeLayout&gt;
  
      &lt;TextView
          android:id="@+id/txtDiaMsg"
          /&gt;
  
      &lt;TableLayout
          android:layout_below="@+id/txtDiaMsg"&gt;
          &lt;TableRow&gt;
              &lt;Button
                  android:id="@+id/yesButton"
                  android:text=" YES "/&gt;
              &lt;Button
                  android:id="@+id/noButton"
                  android:text=" NO "/&gt;
          &lt;/TableRow&gt;
      &lt;/TableLayout&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>How can i link my custom positive button and negative button programmatically ?</p>
  
  <pre><code>DialogInterface.OnClickListener dialogClickListener = new DialogInterface.OnClickListener() {
                              @Override
                              public void onClick(DialogInterface dialog, int which) {
                                  switch (which){
                                      case DialogInterface.BUTTON_POSITIVE:
                                          //Yes button clicked
                                         // do something here
                                          break;
  
                                      case DialogInterface.BUTTON_NEGATIVE:
                                          //No button clicked
                                          break;
                                  }
                              }
                          };
                          AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
                          LayoutInflater li = getLayoutInflater();
                          View view = li.inflate(R.layout.dialogbox_solution, null);
                          builder.setView(view);
                          builder.show();
  </code></pre>