Code example for PopupWindow

Methods: setOnDismissListener

0
     * If you want to do anything when {@link dismiss} is called 
     *  
     * @param listener 
     */ 
    public void setOnDismissListener(PopupWindow.OnDismissListener listener) {
        this.window.setOnDismissListener(listener);
    } 
 
    public void show() { 
        this.preShow();
         
        this.window.setAnimationStyle(R.style.Animations_GrowFromTop);
 
        int[] location = new int[2];
        this.anchor.getLocationOnScreen(location);
 
        Rect anchorRect =
            new Rect(location[0], location[1],
                    location[0] + this.anchor.getWidth(),
                    location[1] + this.anchor.getHeight());
Contextual code suggestions in your IDE  Get Codota for Java