This is good, thanks!
I just changed it a bit: when I run what you suggested, the entire screen is painted with the back color and the dialog does not look as it should (with the previous activity dimmed).
So instead of using
@android:windowBackground
just use
@android:background