define what follows in the styles.xml
file
<style name="CustomDialog" parent="android:Theme.Dialog">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
</style>
and pass it as argument to the AlertDialog
constructor
AlertDialog.Builder imageDialog = new AlertDialog.Builder(SubProducts.this, R.style.CustomDialog);
Or programmatically, through the Dialog
instance you can call
myDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT))