0
             
            onShow(); 
 
            if(mBackground == null) 
            {	 
                    mWindow.setBackgroundDrawable(new BitmapDrawable());
            } else  
            { 
                   	mWindow.setBackgroundDrawable(mBackground);
            } 
 
            // 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 
            mWindow.setWidth(WindowManager.LayoutParams.WRAP_CONTENT);
            mWindow.setHeight(WindowManager.LayoutParams.WRAP_CONTENT);
            mWindow.setTouchable(true);
            mWindow.setFocusable(true);
            mWindow.setOutsideTouchable(true);
 
            mWindow.setContentView(mRootView);
    } 
 
    public void setBackgroundDrawable(Drawable background) 
    { 
            mBackground = background;
    } 
     
    public void setContentView(View root) 
    { 
        mRootView = root;
        mWindow.setContentView(root);
	} 
	 
	/** 
	 * Will inflate and set the view from a resource id 
	 *  
	 * @param layoutResID 
	 */ 
	public void setContentView(int layoutResID) 
	{ 
	        LayoutInflater inflator =
	                        (LayoutInflater) mAnchorView.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	        this.setContentView(inflator.inflate(layoutResID, null));
	} 
	 
	/** 
	 * If you want to do anything when {@link dismiss} is called 
	 *  
	 * @param listener 
	 */ 
	public void setOnDismissListener(PopupWindow.OnDismissListener listener) 
	{ 
	        mWindow.setOnDismissListener(listener);
	} 
	 
	/** 
	 * Displays like a popdown menu from the anchor view 
	 */ 
	public void showLikePopDownMenu()  
	{ 
	        showLikePopDownMenu(0, 0); 
	} 
	 
	public void showLikePopDownMenu(int xOffset, int yOffset) 
	{ 
        this.preShow();
 
        //mWindow.setAnimationStyle(R.style.Animations_PopDownMenu); 
 
        mWindow.showAsDropDown(mAnchorView, xOffset, yOffset);
	} 
	 
	/** 
	 * Displays like a QuickAction from the anchor view. 
	 */