Using AlertDialog.THEME_HOLO_LIGHT works if you want the dialog to be fullscreen. An alternative is to create your own style, for example:
AlertDialog.Builder builder = new AlertDialog.Builder(context, R.style.ThemeDialogCustom); ListAdapter adapter = new CustomDialogAdapter(context, itemsList); builder.setAdapter(adapter, listener); builder.setTitle(title); AlertDialog dialog = builder.create(); dialog.setCanceledOnTouchOutside(true);
there is a style.xml folder in the values, for example below:
<?xml version="1.0" encoding="utf-8"?> <resources> <style name="ThemeDialogCustom" parent="android:Theme.Dialog"> <item name="android:windowFrame">@null</item> <item name="android:windowIsFloating">true</item> <item name="android:windowContentOverlay">@null</item> <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item> <item name="android:windowBackground">@color/transparent_color</item> <item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item> <item name="android:colorBackgroundCacheHint">@null</item> </style> </resources>
also add colors.xml to the values ββfolder:
<?xml version="1.0" encoding="utf-8"?> <resources> <color name="transparent_color">#00000000</color> </resources>
This works for me. Hope this works for you too.
source share