I want to make rounded corners dialog; but after I was done, it appears like this>>
Java
AlertDialog.Builder dialogBuilder= new AlertDialog.Builder(this);
dialogBuilder.setView(R.layout.complain_dialog);
final AlertDialog alertDialog= dialogBuilder.create();
alertDialog.show();
XML
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="100dp"
app:cardBackgroundColor="#FFF"
app:cardCornerRadius="15dp">
<TextView
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginBottom="15dp"
android:background="@color/black_overlay" />
</android.support.v7.widget.CardView>
The problem is: why the dialog is still shown int the background without corners radius?
After searching for a solution to this problem, I found some of these solutions>>
1- Android Dialog - Rounded Corners and Transparency
2- Android custom alert dialog with rounded corners
3- Android dialog background with corner radius has layered background
Java- After test the above solutions
Dialog dialog= new Dialog(getContext());
dialog.setContentView(R.layout.complain_dialog);
dialog.getWindow().setBackgroundDrawable(new
ColorDrawable(Color.TRANSPARENT));
dialog.show();
Result after test the solutions
Now the dialog is not appear at all! Can any one give me solution for this problem? Thank you in advance.