code: def destroy(self):
          
          super(AndroidPopupWindow, self).destroy()
          window = self.window
          if window:
              #: Clear the dismiss listener
              #: (or we get an error during the callback)
              window.setOnDismissListener(None)
              #window.dismiss()
              del self.window
docs: A reimplemented destructor that cancels 
          the dialog before destroying.