I have an activity which is shown in a dialog:

In order to remove border and rounded corners, i tried this:
<resources>
<style name="ActivityDialog" parent="@android:style/Theme.Dialog">
<item name="android:windowBackground">@null</item>
<item name="android:windowFrame">@null</item>
</style>
The border is gone, but sadly also the margin around the dialog.
The border, round corners and margin are all defined by
android:windowBackground. (Parameterandroid:windowFrameis already set to@nullinTheme.Dialogstyle, therefore setting it to@nullagain has no effect.)In order to remove the border and round corners you have to change the
android:windowBackgroundappropriately. TheTheme.Dialogstyle sets it to@android:drawable/panel_background. Which is a 9-patch drawable that looks like this (this one is the hdpi version):As you can see the 9-patch png defines the margin, border and round corners of the dialog theme. To remove the border and round corners you have to create an appropriate drawable. If you want to keep the shadow gradient you have to create set of new 9-patch drawables (one drawable for each dpi). If you don’t need the shadow gradient you can create a shape drawable.
The required style is then: