0
        onShow(); 
 
        if(this.background == null) {
            this.window.setBackgroundDrawable(new BitmapDrawable());
        } else { 
            this.window.setBackgroundDrawable(this.background);
        } 
 
        // if using PopupWindow#setBackgroundDrawable this is the only values of the width and hight that make it work 
        // otherwise you need to set the background of the root viewgroup 
        // and set the popupwindow background to an empty BitmapDrawable 
        this.window.setWidth(WindowManager.LayoutParams.WRAP_CONTENT);
        this.window.setHeight(WindowManager.LayoutParams.WRAP_CONTENT);
        this.window.setTouchable(true);
        this.window.setFocusable(true);
        this.window.setOutsideTouchable(true);
 
        this.window.setContentView(this.root);
    } 
 
    public void setBackgroundDrawable(Drawable background) {
        this.background = background;
    }