Use the `Dialog` to create a transparent theme.
Sample:
Dialog alertDialog = new Dialog(this);
alertDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
alertDialog.setContentView(R.layout.tabs);
alertDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
alertDialog.show();
Note : `AlertDialog` builder is actually not good for designing transparent dialog and will and always have this black background which is actually a Theme for it.
[For more refer this link][1]
[1]: https://stackoverflow.com/questions/25174165/transparent-alertdialog-has-black-background
The problem is that `AlertDialog builder` is actually not good for designing transparent dialog and will and always have this black background which is actually a Theme for it, instead use the `Dialog` to create a transparent theme instead.
**sample:**
Dialog alertDialog = new Dialog(this);
alertDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
alertDialog.setContentView(R.layout.tabs);
alertDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
alertDialog.show();
Using `Dialog` does not require any theme manipulation for transparent background so it is basically easy.