title: How to make custom dialog with rounded corners in android
body: <p><strong>What I am trying to do:</strong> I am trying to make a custom dialog in android With rounded corners.</p>
  
  <p><strong>What is happening:</strong> I am able to make custom dialog but it doesn't have rounded corners. I tried adding a selector but still I couldn't achieve rounded corners.</p>
  
  <p>Below is my code for the same:</p>
  
  <hr>
  
  <p><strong>Java code:</strong> </p>
  
  <pre><code>private void launchDismissDlg() {
  
          dialog = new Dialog(getActivity(), android.R.style.Theme_Dialog);
          dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
          dialog.setContentView(R.layout.dlg_dismiss);
          dialog.setCanceledOnTouchOutside(true);
  
          Button btnReopenId = (Button) dialog.findViewById(R.id.btnReopenId);
          Button btnCancelId = (Button) dialog.findViewById(R.id.btnCancelId);
  
          btnReopenId.setOnClickListener(new OnClickListener() {
              @Override
              public void onClick(View v) {
  
  
  
              }
          });
  
  
          btnCancelId.setOnClickListener(new OnClickListener() {
              @Override
              public void onClick(View v) {
  
  
  
              }
          });
          dialog.setCanceledOnTouchOutside(false);
          dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
          dialog.getWindow().setLayout(LayoutParams.MATCH_PARENT,LayoutParams.WRAP_CONTENT);
          dialog.show();
  
      }
  </code></pre>
  
  <p><strong>xml code:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@android:color/white"
      android:orientation="vertical" &gt;
  
      &lt;TableLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content" &gt;
  
          &lt;TableRow
              android:id="@+id/tableRow1"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginTop="20dp"
              android:gravity="center" &gt;
  
              &lt;TextView
                  android:id="@+id/textView1"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:gravity="center"
                  android:text="&amp;quot;I WOULD LIKE TO DISMISS THE VENDOR&amp;quot;"
                  android:textColor="@color/col_dlg_blue_light"
                  android:textSize="14sp"
                  android:textStyle="bold" /&gt;
          &lt;/TableRow&gt;
  
          &lt;TableRow
              android:id="@+id/tableRow2"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginTop="5dp"
              android:gravity="center" &gt;
  
              &lt;TextView
                  android:id="@+id/textView2"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:gravity="center"
                  android:text="BECAUSE"
                  android:textColor="@android:color/black"
                  android:textStyle="bold" /&gt;
          &lt;/TableRow&gt;
  
  
  
          &lt;TableRow
              android:id="@+id/tableRow4"
              android:layout_width="match_parent"
              android:layout_height="wrap_content" &gt;
  
              &lt;Button
                  android:id="@+id/btnReopenId"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  android:background="@color/col_dlg_green_light"
                  android:text="REOPEN"
                  android:padding="5dp"
                  android:textSize="14sp"
                  android:textColor="@android:color/white"
                  android:textStyle="bold" /&gt;
  
              &lt;Button
                  android:id="@+id/btnCancelId"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  android:background="@color/col_dlg_pink_light"
                  android:text="CANCEL"
                  android:padding="5dp"
                  android:textSize="14sp"
                  android:textColor="@android:color/white"
                  android:textStyle="bold" /&gt;
          &lt;/TableRow&gt;
      &lt;/TableLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>