How do I create a PopupWindow in Android with a white background, but still keep the shadow? I am trying to create something like this :

By default, my PopupWindow has a dark background. So I set the contents of the popup to a white background, which this gives me:

Which has a shadow, but still has a black βborder,β which is actually just the uncovered parts of the pop-up background.
So, I'm trying to set the background of the popup to white using "popupWindow.setBackgroundDrawable (new ColorDrawable (Color.WHITE)" that calls this :

which gives the correct background color, but also removes the shadow.
So, is there an easy way to keep the shadow, but set the background to white. Is there anything else I should use instead of PopupWindow to create what I want? Or do I need to use 9 patches or something else?
source share