I went crazy finding a solution for this problem until I came across a solution.
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
// Setup the layout
LayoutInflater inflater = getActivity().getLayoutInflater();
final View root = inflater.inflate(*"YOUR LAYOUT"*, null);
root.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
//Customizing the dialog features
final Dialog dialog = new Dialog(getActivity());
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(root);
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(getResources().getColor(*"YOUR SELECTED COLOR"*)));
dialog.getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
return dialog;
}