I am trying to implement AlertDialog based on DialogFragment with this code:
public class AlertDialogFragment extends DialogFragment {
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
return new AlertDialog.Builder(getActivity())
.setTitle("title")
.setMessage("message")
.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
})
.setNegativeButton(android.R.string.no, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
})
.create();
}
}
It working well, but I get a strange white border around AlertDialog:
How to remove this border (preferably programmatically)?
UPDATE: my styles.xml contains this code:
<style name="AppBaseTheme" parent="@android:style/Theme.Holo.Light">
<item name="android:alertDialogTheme">@style/MyDialogTheme</item>
</style>
<style name="MyDialogTheme" parent="@android:style/Theme.Holo.Light.Dialog"></style>
When I remove <item name="android:alertDialogTheme">@style/MyDialogTheme</item>
row, this issue is gone away. But I need this row because I want to customize AlertDialog. How to fix this style?