I created a special alertdialog with the following code:
AlertDialog.Builder builder; AlertDialog alertDialog; LayoutInflater inflater = (LayoutInflater)ActivityName.this.getSystemService(LAYOUT_INFLATER_SERVICE); View layout = inflater.inflate(R.layout.custom_layout,(ViewGroup)findViewById(R.id.layout_root)); builder = new AlertDialog.Builder(getParent()); builder.setView(layout); alertDialog = builder.create(); alertDialog.show();
The problem is that the popup is surrounded by the background of the dialog having its own empty title space (since the title is not set). How to remove it. I tried to set a custom style via ContextThemeWrapper as builder = new AlertDialog.Builder(new ContextThemeWrapper(getParent(), R.style.CustomDialogTheme));
But it does not work. How can I do it?!!! Thanks in advance. Custom xml style is below:
<style name="CustomDialogTheme" parent="android:style/Theme.Dialog.Alert"> <item name="android:windowIsFloating">false</item> <item name="android:windowNoTitle">true</item> </style>

source share