Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/widget/PopupWindow#nestedclasses) \| [XML Attrs](https://developer.android.com/reference/android/widget/PopupWindow#lattrs) \| [Constants](https://developer.android.com/reference/android/widget/PopupWindow#constants) \| [Ctors](https://developer.android.com/reference/android/widget/PopupWindow#pubctors) \| [Methods](https://developer.android.com/reference/android/widget/PopupWindow#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/widget/PopupWindow#inhmethods)

# PopupWindow

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/widget/PopupWindow "View this page in Kotlin") \|Java


`
public


class
PopupWindow
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.widget.PopupWindow |

<br />

*** ** * ** ***

<br />


This class represents a popup window that can be used to display an
arbitrary view. The popup window is a floating container that appears on top
of the current activity.

### Animation


On all versions of Android, popup window enter and exit animations may be
specified by calling `https://developer.android.com/reference/android/widget/PopupWindow#setAnimationStyle(int)` and passing the
resource ID for an animation style that defines `windowEnterAnimation`
and `windowExitAnimation`. For example, passing
`https://developer.android.com/reference/android/R.style#Animation_Dialog` will give a scale and alpha
animation.


A window animation style may also be specified in the popup window's style
XML via the `https://developer.android.com/reference/android/R.styleable#PopupWindow_popupAnimationStyle`
attribute.


Starting with API 23, more complex popup window enter and exit transitions
may be specified by calling either `https://developer.android.com/reference/android/widget/PopupWindow#setEnterTransition(android.transition.Transition)`
or `https://developer.android.com/reference/android/widget/PopupWindow#setExitTransition(android.transition.Transition)` and passing a `https://developer.android.com/reference/android/transition/Transition`.


Popup enter and exit transitions may also be specified in the popup window's
style XML via the `https://developer.android.com/reference/android/R.styleable#PopupWindow_popupEnterTransition`
and `https://developer.android.com/reference/android/R.styleable#PopupWindow_popupExitTransition`
attributes, respectively.

<br />

**See also:**

- `https://developer.android.com/reference/android/widget/AutoCompleteTextView`
- `https://developer.android.com/reference/android/widget/Spinner`

## Summary

| ### Nested classes ||
|---|---|
| ` interface` | `https://developer.android.com/reference/android/widget/PopupWindow.OnDismissListener` Listener that is called when this popup window is dismissed. |

| ### XML attributes ||
|---|---|
| [`android:overlapAnchor`](https://developer.android.com/reference/android/widget/PopupWindow#attr_android:overlapAnchor) | Whether the popup window should overlap its anchor view. |
| [`android:popupAnimationStyle`](https://developer.android.com/reference/android/widget/PopupWindow#attr_android:popupAnimationStyle) | The animation style to use for the popup window. |
| [`android:popupBackground`](https://developer.android.com/reference/android/widget/PopupWindow#attr_android:popupBackground) | The background to use for the popup window. |
| [`android:popupElevation`](https://developer.android.com/reference/android/widget/PopupWindow#attr_android:popupElevation) | Window elevation to use for the popup window. |
| [`android:popupEnterTransition`](https://developer.android.com/reference/android/widget/PopupWindow#attr_android:popupEnterTransition) | Transition used to move views into the popup window. |
| [`android:popupExitTransition`](https://developer.android.com/reference/android/widget/PopupWindow#attr_android:popupExitTransition) | Transition used to move views out of the popup window. |

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/widget/PopupWindow#INPUT_METHOD_FROM_FOCUSABLE` Mode for `https://developer.android.com/reference/android/widget/PopupWindow#setInputMethodMode(int)`: the requirements for the input method should be based on the focusability of the popup. |
| `int` | `https://developer.android.com/reference/android/widget/PopupWindow#INPUT_METHOD_NEEDED` Mode for `https://developer.android.com/reference/android/widget/PopupWindow#setInputMethodMode(int)`: this popup always needs to work with an input method, regardless of whether it is focusable. |
| `int` | `https://developer.android.com/reference/android/widget/PopupWindow#INPUT_METHOD_NOT_NEEDED` Mode for `https://developer.android.com/reference/android/widget/PopupWindow#setInputMethodMode(int)`: this popup never needs to work with an input method, regardless of whether it is focusable. |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/widget/PopupWindow#PopupWindow()() ` <br /> Create a new empty, non focusable popup window of dimension (0,0). |
| ` https://developer.android.com/reference/android/widget/PopupWindow#PopupWindow(android.content.Context)(https://developer.android.com/reference/android/content/Context context) ` <br /> Create a new empty, non focusable popup window of dimension (0,0). |
| ` https://developer.android.com/reference/android/widget/PopupWindow#PopupWindow(android.content.Context,%20android.util.AttributeSet)(https://developer.android.com/reference/android/content/Context context, https://developer.android.com/reference/android/util/AttributeSet attrs) ` <br /> Create a new empty, non focusable popup window of dimension (0,0). |
| ` https://developer.android.com/reference/android/widget/PopupWindow#PopupWindow(android.content.Context,%20android.util.AttributeSet,%20int)(https://developer.android.com/reference/android/content/Context context, https://developer.android.com/reference/android/util/AttributeSet attrs, int defStyleAttr) ` <br /> Create a new empty, non focusable popup window of dimension (0,0). |
| ` https://developer.android.com/reference/android/widget/PopupWindow#PopupWindow(android.content.Context,%20android.util.AttributeSet,%20int,%20int)(https://developer.android.com/reference/android/content/Context context, https://developer.android.com/reference/android/util/AttributeSet attrs, int defStyleAttr, int defStyleRes) ` <br /> Create a new, empty, non focusable popup window of dimension (0,0). |
| ` https://developer.android.com/reference/android/widget/PopupWindow#PopupWindow(android.view.View)(https://developer.android.com/reference/android/view/View contentView) ` <br /> Create a new non focusable popup window which can display the contentView. |
| ` https://developer.android.com/reference/android/widget/PopupWindow#PopupWindow(android.view.View,%20int,%20int)(https://developer.android.com/reference/android/view/View contentView, int width, int height) ` <br /> Create a new non focusable popup window which can display the contentView. |
| ` https://developer.android.com/reference/android/widget/PopupWindow#PopupWindow(android.view.View,%20int,%20int,%20boolean)(https://developer.android.com/reference/android/view/View contentView, int width, int height, boolean focusable) ` <br /> Create a new popup window which can display the contentView. |
| ` https://developer.android.com/reference/android/widget/PopupWindow#PopupWindow(int,%20int)(int width, int height) ` <br /> Create a new empty, non focusable popup window. |

| ### Public methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#dismiss()() ` Disposes of the popup window. |
| ` int` | ` https://developer.android.com/reference/android/widget/PopupWindow#getAnimationStyle()() ` <br /> Return the animation style to use the popup appears and disappears <br /> |
| ` https://developer.android.com/reference/android/graphics/drawable/Drawable` | ` https://developer.android.com/reference/android/widget/PopupWindow#getBackground()() ` Return the drawable used as the popup window's background. |
| ` https://developer.android.com/reference/android/view/View` | ` https://developer.android.com/reference/android/widget/PopupWindow#getContentView()() ` <br /> Return the view used as the content of the popup window. |
| ` float` | ` https://developer.android.com/reference/android/widget/PopupWindow#getElevation()() ` |
| ` https://developer.android.com/reference/android/transition/Transition` | ` https://developer.android.com/reference/android/widget/PopupWindow#getEnterTransition()() ` Returns the enter transition to be used when the popup window is shown. |
| ` https://developer.android.com/reference/android/graphics/Rect` | ` https://developer.android.com/reference/android/widget/PopupWindow#getEpicenterBounds()() ` <br /> Returns bounds which are used as a center of the enter and exit transitions. |
| ` https://developer.android.com/reference/android/transition/Transition` | ` https://developer.android.com/reference/android/widget/PopupWindow#getExitTransition()() ` Returns the exit transition to be used when the popup window is dismissed. |
| ` int` | ` https://developer.android.com/reference/android/widget/PopupWindow#getHeight()() ` Returns the popup's requested height. |
| ` int` | ` https://developer.android.com/reference/android/widget/PopupWindow#getInputMethodMode()() ` Return the current value in `https://developer.android.com/reference/android/widget/PopupWindow#setInputMethodMode(int)`. |
| ` int` | ` https://developer.android.com/reference/android/widget/PopupWindow#getMaxAvailableHeight(android.view.View)(https://developer.android.com/reference/android/view/View anchor) ` Returns the maximum height that is available for the popup to be completely shown. |
| ` int` | ` https://developer.android.com/reference/android/widget/PopupWindow#getMaxAvailableHeight(android.view.View,%20int)(https://developer.android.com/reference/android/view/View anchor, int yOffset) ` Returns the maximum height that is available for the popup to be completely shown. |
| ` int` | ` https://developer.android.com/reference/android/widget/PopupWindow#getMaxAvailableHeight(android.view.View,%20int,%20boolean)(https://developer.android.com/reference/android/view/View anchor, int yOffset, boolean ignoreBottomDecorations) ` Returns the maximum height that is available for the popup to be completely shown, optionally ignoring any bottom decorations such as the input method. |
| ` boolean` | ` https://developer.android.com/reference/android/widget/PopupWindow#getOverlapAnchor()() ` Returns whether the popup window should overlap its anchor view when displayed as a drop-down. |
| ` int` | ` https://developer.android.com/reference/android/widget/PopupWindow#getSoftInputMode()() ` Returns the current value in `https://developer.android.com/reference/android/widget/PopupWindow#setSoftInputMode(int)`. |
| ` int` | ` https://developer.android.com/reference/android/widget/PopupWindow#getWidth()() ` Returns the popup's requested width. |
| ` int` | ` https://developer.android.com/reference/android/widget/PopupWindow#getWindowLayoutType()() ` Returns the layout type for this window. |
| ` boolean` | ` https://developer.android.com/reference/android/widget/PopupWindow#isAboveAnchor()() ` Indicates whether the popup is showing above (the y coordinate of the popup's bottom is less than the y coordinate of the anchor) or below the anchor view (the y coordinate of the popup is greater than y coordinate of the anchor's bottom). |
| ` boolean` | ` https://developer.android.com/reference/android/widget/PopupWindow#isAttachedInDecor()() ` <br /> Indicates whether the popup window will be attached in the decor frame of its parent window. |
| ` boolean` | ` https://developer.android.com/reference/android/widget/PopupWindow#isClippedToScreen()() ` <br /> Indicates whether this popup will be clipped to the screen and not to the containing window <br /> <br /> |
| ` boolean` | ` https://developer.android.com/reference/android/widget/PopupWindow#isClippingEnabled()() ` <br /> Indicates whether clipping of the popup window is enabled. |
| ` boolean` | ` https://developer.android.com/reference/android/widget/PopupWindow#isFocusable()() ` <br /> Indicate whether the popup window can grab the focus. |
| ` boolean` | ` https://developer.android.com/reference/android/widget/PopupWindow#isLaidOutInScreen()() ` <br /> Indicates whether the popup window will be forced into using absolute screen coordinates for positioning. |
| ` boolean` | ` https://developer.android.com/reference/android/widget/PopupWindow#isOutsideTouchable()() ` <br /> Indicates whether the popup window will be informed of touch events outside of its window. |
| ` boolean` | ` https://developer.android.com/reference/android/widget/PopupWindow#isShowing()() ` <br /> Indicate whether this popup window is showing on screen. |
| ` boolean` | ` https://developer.android.com/reference/android/widget/PopupWindow#isSplitTouchEnabled()() ` <br /> Indicates whether the popup window supports splitting touches. |
| ` boolean` | ` https://developer.android.com/reference/android/widget/PopupWindow#isTouchModal()() ` <br /> Indicates whether outside touches will be sent to this window or other windows behind it <br /> <br /> |
| ` boolean` | ` https://developer.android.com/reference/android/widget/PopupWindow#isTouchable()() ` <br /> Indicates whether the popup window receives touch events. |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#setAnimationStyle(int)(int animationStyle) ` <br /> Change the animation style resource for this popup. |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#setAttachedInDecor(boolean)(boolean enabled) ` <br /> This will attach the popup window to the decor frame of the parent window to avoid overlaping with screen decorations like the navigation bar. |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#setBackgroundDrawable(android.graphics.drawable.Drawable)(https://developer.android.com/reference/android/graphics/drawable/Drawable background) ` Specifies the background drawable for this popup window. |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#setClippingEnabled(boolean)(boolean enabled) ` <br /> Allows the popup window to extend beyond the bounds of the screen. |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#setContentView(android.view.View)(https://developer.android.com/reference/android/view/View contentView) ` <br /> Change the popup's content. |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#setElevation(float)(float elevation) ` Specifies the elevation for this popup window. |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#setEnterTransition(android.transition.Transition)(https://developer.android.com/reference/android/transition/Transition enterTransition) ` Sets the enter transition to be used when the popup window is shown. |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#setEpicenterBounds(android.graphics.Rect)(https://developer.android.com/reference/android/graphics/Rect bounds) ` <br /> Sets the bounds used as the epicenter of the enter and exit transitions. |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#setExitTransition(android.transition.Transition)(https://developer.android.com/reference/android/transition/Transition exitTransition) ` Sets the exit transition to be used when the popup window is dismissed. |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#setFocusable(boolean)(boolean focusable) ` <br /> Changes the focusability of the popup window. |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#setHeight(int)(int height) ` Sets the popup's requested height. |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#setIgnoreCheekPress()() ` Set the flag on popup to ignore cheek press events; by default this flag is set to false which means the popup will not ignore cheek press dispatch events. |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#setInputMethodMode(int)(int mode) ` Control how the popup operates with an input method: one of `https://developer.android.com/reference/android/widget/PopupWindow#INPUT_METHOD_FROM_FOCUSABLE`, `https://developer.android.com/reference/android/widget/PopupWindow#INPUT_METHOD_NEEDED`, or `https://developer.android.com/reference/android/widget/PopupWindow#INPUT_METHOD_NOT_NEEDED`. |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#setIsClippedToScreen(boolean)(boolean enabled) ` <br /> Clip this popup window to the screen, but not to the containing window. |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#setIsLaidOutInScreen(boolean)(boolean enabled) ` <br /> Allows the popup window to force the flag `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#FLAG_LAYOUT_IN_SCREEN`, overriding default behavior. |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#setOnDismissListener(android.widget.PopupWindow.OnDismissListener)(https://developer.android.com/reference/android/widget/PopupWindow.OnDismissListener onDismissListener) ` Sets the listener to be called when the window is dismissed. |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#setOutsideTouchable(boolean)(boolean touchable) ` <br /> Controls whether the pop-up will be informed of touch events outside of its window. |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#setOverlapAnchor(boolean)(boolean overlapAnchor) ` Sets whether the popup window should overlap its anchor view when displayed as a drop-down. |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#setSoftInputMode(int)(int mode) ` Sets the operating mode for the soft input area. |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#setSplitTouchEnabled(boolean)(boolean enabled) ` <br /> Allows the popup window to split touches across other windows that also support split touch. |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#setTouchInterceptor(android.view.View.OnTouchListener)(https://developer.android.com/reference/android/view/View.OnTouchListener l) ` Set a callback for all touch events being dispatched to the popup window. |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#setTouchModal(boolean)(boolean touchModal) ` <br /> Set whether this window is touch modal or if outside touches will be sent to other windows behind it. |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#setTouchable(boolean)(boolean touchable) ` <br /> Changes the touchability of the popup window. |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#setWidth(int)(int width) ` Sets the popup's requested width. |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#setWindowLayoutMode(int,%20int)(int widthSpec, int heightSpec) ` *This method was deprecated in API level 23. Use `https://developer.android.com/reference/android/widget/PopupWindow#setWidth(int)` and `https://developer.android.com/reference/android/widget/PopupWindow#setHeight(int)`.* |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#setWindowLayoutType(int)(int layoutType) ` Set the layout type for this window. |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#showAsDropDown(android.view.View)(https://developer.android.com/reference/android/view/View anchor) ` Display the content view in a popup window anchored to the bottom-left corner of the anchor view. |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#showAsDropDown(android.view.View,%20int,%20int,%20int)(https://developer.android.com/reference/android/view/View anchor, int xoff, int yoff, int gravity) ` Displays the content view in a popup window anchored to the corner of another view. |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#showAsDropDown(android.view.View,%20int,%20int)(https://developer.android.com/reference/android/view/View anchor, int xoff, int yoff) ` Display the content view in a popup window anchored to the bottom-left corner of the anchor view offset by the specified x and y coordinates. |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#showAtLocation(android.view.View,%20int,%20int,%20int)(https://developer.android.com/reference/android/view/View parent, int gravity, int x, int y) ` <br /> Display the content view in a popup window at the specified location. |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#update(android.view.View,%20int,%20int)(https://developer.android.com/reference/android/view/View anchor, int width, int height) ` Updates the position and the dimension of the popup window. |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#update(android.view.View,%20int,%20int,%20int,%20int)(https://developer.android.com/reference/android/view/View anchor, int xoff, int yoff, int width, int height) ` Updates the position and the dimension of the popup window. |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#update(int,%20int)(int width, int height) ` Updates the dimension of the popup window. |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#update()() ` Updates the state of the popup window, if it is currently being displayed, from the currently set state. |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#update(int,%20int,%20int,%20int,%20boolean)(int x, int y, int width, int height, boolean force) ` Updates the position and the dimension of the popup window. |
| ` void` | ` https://developer.android.com/reference/android/widget/PopupWindow#update(int,%20int,%20int,%20int)(int x, int y, int width, int height) ` Updates the position and the dimension of the popup window. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||

## XML attributes

### android:overlapAnchor

Whether the popup window should overlap its anchor view.

May be a boolean value, such as "`true`" or
"`false`".

<br />

### android:popupAnimationStyle

The animation style to use for the popup window.

May be a reference to another resource, in the form
"`@[+][*package*:]*type*/*name*`" or a theme
attribute in the form
"`?[*package*:]*type*/*name*`".

<br />

### android:popupBackground

The background to use for the popup window.

May be a reference to another resource, in the form
"`@[+][*package*:]*type*/*name*`" or a theme
attribute in the form
"`?[*package*:]*type*/*name*`".

May be a color value, in the form of "`#*rgb*`",
"`#*argb*`", "`#*rrggbb*`", or
"`#*aarrggbb*`".

<br />

**Related methods:**

- `https://developer.android.com/reference/android/widget/PopupWindow#setBackgroundDrawable(android.graphics.drawable.Drawable)`

### android:popupElevation

Window elevation to use for the popup window.

May be a dimension value, which is a floating point number appended with a
unit such as "`14.5sp`".
Available units are: px (pixels), dp (density-independent pixels),
sp (scaled pixels based on preferred font size), in (inches), and
mm (millimeters).

<br />

**Related methods:**

- `https://developer.android.com/reference/android/widget/PopupWindow#setElevation(float)`

### android:popupEnterTransition

Transition used to move views into the popup window.

May be a reference to another resource, in the form
"`@[+][*package*:]*type*/*name*`" or a theme
attribute in the form
"`?[*package*:]*type*/*name*`".

<br />

**Related methods:**

- `https://developer.android.com/reference/android/widget/PopupWindow#setEnterTransition(android.transition.Transition)`

### android:popupExitTransition

Transition used to move views out of the popup window.

May be a reference to another resource, in the form
"`@[+][*package*:]*type*/*name*`" or a theme
attribute in the form
"`?[*package*:]*type*/*name*`".

<br />

**Related methods:**

- `https://developer.android.com/reference/android/widget/PopupWindow#setExitTransition(android.transition.Transition)`

## Constants

### INPUT_METHOD_FROM_FOCUSABLE

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int INPUT_METHOD_FROM_FOCUSABLE
```

Mode for `https://developer.android.com/reference/android/widget/PopupWindow#setInputMethodMode(int)`: the requirements for the
input method should be based on the focusability of the popup. That is
if it is focusable than it needs to work with the input method, else
it doesn't.

<br />

Constant Value:

0
(0x00000000)


### INPUT_METHOD_NEEDED

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int INPUT_METHOD_NEEDED
```

Mode for `https://developer.android.com/reference/android/widget/PopupWindow#setInputMethodMode(int)`: this popup always needs to
work with an input method, regardless of whether it is focusable. This
means that it will always be displayed so that the user can also operate
the input method while it is shown.

<br />

Constant Value:

1
(0x00000001)


### INPUT_METHOD_NOT_NEEDED

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int INPUT_METHOD_NOT_NEEDED
```

Mode for `https://developer.android.com/reference/android/widget/PopupWindow#setInputMethodMode(int)`: this popup never needs to
work with an input method, regardless of whether it is focusable. This
means that it will always be displayed to use as much space on the
screen as needed, regardless of whether this covers the input method.

<br />

Constant Value:

2
(0x00000002)


## Public constructors

### PopupWindow

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public PopupWindow ()
```

<br />

Create a new empty, non focusable popup window of dimension (0,0).

The popup does not provide any background. This should be handled
by the content view.

<br />

<br />

### PopupWindow

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public PopupWindow (Context context)
```

<br />

Create a new empty, non focusable popup window of dimension (0,0).

The popup does provide a background.

<br />

<br />

| Parameters ||
|---|---|
| `context` | `Context` <br /> |

### PopupWindow

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public PopupWindow (Context context, 
                AttributeSet attrs)
```

<br />

Create a new empty, non focusable popup window of dimension (0,0).

The popup does provide a background.

<br />

<br />

| Parameters ||
|---|---|
| `context` | `Context` <br /> |
| `attrs` | `AttributeSet` <br /> |

### PopupWindow

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public PopupWindow (Context context, 
                AttributeSet attrs, 
                int defStyleAttr)
```

<br />

Create a new empty, non focusable popup window of dimension (0,0).

The popup does provide a background.

<br />

<br />

| Parameters ||
|---|---|
| `context` | `Context` <br /> |
| `attrs` | `AttributeSet` <br /> |
| `defStyleAttr` | `int` <br /> |

### PopupWindow

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public PopupWindow (Context context, 
                AttributeSet attrs, 
                int defStyleAttr, 
                int defStyleRes)
```

<br />

Create a new, empty, non focusable popup window of dimension (0,0).

The popup does not provide a background.

<br />

<br />

| Parameters ||
|---|---|
| `context` | `Context` <br /> |
| `attrs` | `AttributeSet` <br /> |
| `defStyleAttr` | `int` <br /> |
| `defStyleRes` | `int` <br /> |

### PopupWindow

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public PopupWindow (View contentView)
```

<br />

Create a new non focusable popup window which can display the
contentView. The dimension of the window are (0,0).

The popup does not provide any background. This should be handled
by the content view.

<br />

<br />

| Parameters ||
|---|---|
| `contentView` | `View`: the popup's content <br /> |

### PopupWindow

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public PopupWindow (View contentView, 
                int width, 
                int height)
```

<br />

Create a new non focusable popup window which can display the
contentView. The dimension of the window must be passed to
this constructor.

The popup does not provide any background. This should be handled
by the content view.

<br />

<br />

| Parameters ||
|---|---|
| `contentView` | `View`: the popup's content <br /> |
| `width` | `int`: the popup's width <br /> |
| `height` | `int`: the popup's height <br /> |

### PopupWindow

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public PopupWindow (View contentView, 
                int width, 
                int height, 
                boolean focusable)
```

<br />

Create a new popup window which can display the contentView.
The dimension of the window must be passed to this constructor.

The popup does not provide any background. This should be handled
by the content view.

<br />

<br />

| Parameters ||
|---|---|
| `contentView` | `View`: the popup's content <br /> |
| `width` | `int`: the popup's width <br /> |
| `height` | `int`: the popup's height <br /> |
| `focusable` | `boolean`: true if the popup can be focused, false otherwise <br /> |

### PopupWindow

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public PopupWindow (int width, 
                int height)
```

<br />

Create a new empty, non focusable popup window. The dimension of the
window must be passed to this constructor.

The popup does not provide any background. This should be handled
by the content view.

<br />

<br />

| Parameters ||
|---|---|
| `width` | `int`: the popup's width <br /> |
| `height` | `int`: the popup's height <br /> |

## Public methods

### dismiss

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void dismiss ()
```

Disposes of the popup window. This method can be invoked only after
`https://developer.android.com/reference/android/widget/PopupWindow#showAsDropDown(android.view.View)` has been executed. Failing
that, calling this method will have no effect.

<br />

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#showAsDropDown(android.view.View)`

### getAnimationStyle

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getAnimationStyle ()
```

<br />

Return the animation style to use the popup appears and disappears

<br />

<br />

| Returns ||
|---|---|
| `int` | the animation style to use the popup appears and disappears <br /> |

### getBackground

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Drawable getBackground ()
```

Return the drawable used as the popup window's background.

<br />

**Related XML Attributes:**

- [android:popupBackground](https://developer.android.com/reference/android/widget/PopupWindow#attr_android:popupBackground)

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/drawable/Drawable` | the background drawable or `null` if not set <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#setBackgroundDrawable(android.graphics.drawable.Drawable)`

### getContentView

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public View getContentView ()
```

<br />

Return the view used as the content of the popup window.

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/View` | a `https://developer.android.com/reference/android/view/View` representing the popup's content <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#setContentView(android.view.View)`

### getElevation

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float getElevation ()
```

<br />

<br />

**Related XML Attributes:**

- [android:popupElevation](https://developer.android.com/reference/android/widget/PopupWindow#attr_android:popupElevation)

| Returns ||
|---|---|
| `float` | the elevation for this popup window in pixels <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#setElevation(float)`

### getEnterTransition

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Transition getEnterTransition ()
```

Returns the enter transition to be used when the popup window is shown.

<br />

**Related XML Attributes:**

- [android:popupEnterTransition](https://developer.android.com/reference/android/widget/PopupWindow#attr_android:popupEnterTransition)

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/transition/Transition` | the enter transition, or `null` if not set <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#setEnterTransition(android.transition.Transition)`

### getEpicenterBounds

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Rect getEpicenterBounds ()
```

<br />

Returns bounds which are used as a center of the enter and exit transitions.

<br />

Transitions use Rect, referred to as the epicenter, to orient
the direction of travel. For popup windows, the anchor view bounds are
used as the default epicenter.

See `https://developer.android.com/reference/android/transition/Transition#setEpicenterCallback(android.transition.Transition.EpicenterCallback)` for more
information about how transition epicenters work.

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/Rect` | bounds relative to anchor view, or `null` if not set <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#setEpicenterBounds(android.graphics.Rect)`

### getExitTransition

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Transition getExitTransition ()
```

Returns the exit transition to be used when the popup window is
dismissed.

<br />

**Related XML Attributes:**

- [android:popupExitTransition](https://developer.android.com/reference/android/widget/PopupWindow#attr_android:popupExitTransition)

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/transition/Transition` | the exit transition, or `null` if not set <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#setExitTransition(android.transition.Transition)`

### getHeight

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getHeight ()
```

Returns the popup's requested height. May be a layout constant such as
`https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#WRAP_CONTENT` or `https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#MATCH_PARENT`.


The actual size of the popup may depend on other factors such as
clipping and window layout.

<br />

| Returns ||
|---|---|
| `int` | the popup height in pixels or a layout constant <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#setHeight(int)`

### getInputMethodMode

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getInputMethodMode ()
```

Return the current value in `https://developer.android.com/reference/android/widget/PopupWindow#setInputMethodMode(int)`.

<br />

| Returns ||
|---|---|
| `int` | <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#setInputMethodMode(int)`

### getMaxAvailableHeight

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getMaxAvailableHeight (View anchor)
```

Returns the maximum height that is available for the popup to be
completely shown. It is recommended that this height be the maximum for
the popup's height, otherwise it is possible that the popup will be
clipped.

<br />

| Parameters ||
|---|---|
| `anchor` | `View`: The view on which the popup window must be anchored. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `int` | The maximum available height for the popup to be completely shown. <br /> |

### getMaxAvailableHeight

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getMaxAvailableHeight (View anchor, 
                int yOffset)
```

Returns the maximum height that is available for the popup to be
completely shown. It is recommended that this height be the maximum for
the popup's height, otherwise it is possible that the popup will be
clipped.

<br />

| Parameters ||
|---|---|
| `anchor` | `View`: The view on which the popup window must be anchored. This value cannot be `null`. <br /> |
| `yOffset` | `int`: y offset from the view's bottom edge <br /> |

| Returns ||
|---|---|
| `int` | The maximum available height for the popup to be completely shown. <br /> |

### getMaxAvailableHeight

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getMaxAvailableHeight (View anchor, 
                int yOffset, 
                boolean ignoreBottomDecorations)
```

Returns the maximum height that is available for the popup to be
completely shown, optionally ignoring any bottom decorations such as
the input method. It is recommended that this height be the maximum for
the popup's height, otherwise it is possible that the popup will be
clipped.

<br />

| Parameters ||
|---|---|
| `anchor` | `View`: The view on which the popup window must be anchored. This value cannot be `null`. <br /> |
| `yOffset` | `int`: y offset from the view's bottom edge <br /> |
| `ignoreBottomDecorations` | `boolean`: if true, the height returned will be all the way to the bottom of the display, ignoring any bottom decorations <br /> |

| Returns ||
|---|---|
| `int` | The maximum available height for the popup to be completely shown. <br /> |

### getOverlapAnchor

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean getOverlapAnchor ()
```

Returns whether the popup window should overlap its anchor view when
displayed as a drop-down.

<br />

| Returns ||
|---|---|
| `boolean` | Whether the popup should overlap its anchor. <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#setOverlapAnchor(boolean)`

### getSoftInputMode

Added in [API level 4](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getSoftInputMode ()
```

Returns the current value in `https://developer.android.com/reference/android/widget/PopupWindow#setSoftInputMode(int)`.

<br />

| Returns ||
|---|---|
| `int` | Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#SOFT_INPUT_STATE_UNSPECIFIED` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#SOFT_INPUT_STATE_UNCHANGED` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#SOFT_INPUT_STATE_HIDDEN` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#SOFT_INPUT_STATE_ALWAYS_HIDDEN` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#SOFT_INPUT_STATE_VISIBLE` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#SOFT_INPUT_STATE_ALWAYS_VISIBLE` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#SOFT_INPUT_ADJUST_UNSPECIFIED` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#SOFT_INPUT_ADJUST_RESIZE` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#SOFT_INPUT_ADJUST_PAN` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#SOFT_INPUT_ADJUST_NOTHING` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#SOFT_INPUT_IS_FORWARD_NAVIGATION` |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#setSoftInputMode(int)`
- `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#softInputMode`

### getWidth

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getWidth ()
```

Returns the popup's requested width. May be a layout constant such as
`https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#WRAP_CONTENT` or `https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#MATCH_PARENT`.


The actual size of the popup may depend on other factors such as
clipping and window layout.

<br />

| Returns ||
|---|---|
| `int` | the popup width in pixels or a layout constant <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#setWidth(int)`

### getWindowLayoutType

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getWindowLayoutType ()
```

Returns the layout type for this window.

<br />

| Returns ||
|---|---|
| `int` | <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#setWindowLayoutType(int)`

### isAboveAnchor

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isAboveAnchor ()
```

Indicates whether the popup is showing above (the y coordinate of the popup's bottom
is less than the y coordinate of the anchor) or below the anchor view (the y coordinate
of the popup is greater than y coordinate of the anchor's bottom).

The value returned
by this method is meaningful only after `https://developer.android.com/reference/android/widget/PopupWindow#showAsDropDown(android.view.View)`
or `https://developer.android.com/reference/android/widget/PopupWindow#showAsDropDown(android.view.View,%20int,%20int)` was invoked.

<br />

| Returns ||
|---|---|
| `boolean` | True if this popup is showing above the anchor view, false otherwise. <br /> |

### isAttachedInDecor

Added in [API level 22](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isAttachedInDecor ()
```

<br />

Indicates whether the popup window will be attached in the decor frame of its parent
window.

<br />

| Returns ||
|---|---|
| `boolean` | true if the window will be attached to the decor frame of its parent window. <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#setAttachedInDecor(boolean)`
- `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#FLAG_LAYOUT_ATTACHED_IN_DECOR`

### isClippedToScreen

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isClippedToScreen ()
```

<br />

Indicates whether this popup will be clipped to the screen and not to the
containing window

<br />

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if popup will be clipped to the screen instead of the window, false otherwise <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#setIsClippedToScreen(boolean)`

### isClippingEnabled

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isClippingEnabled ()
```

<br />

Indicates whether clipping of the popup window is enabled.

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if the clipping is enabled, false otherwise <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#setClippingEnabled(boolean)`

### isFocusable

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isFocusable ()
```

<br />

Indicate whether the popup window can grab the focus.

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if the popup is focusable, false otherwise <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#setFocusable(boolean)`

### isLaidOutInScreen

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isLaidOutInScreen ()
```

<br />

Indicates whether the popup window will be forced into using absolute screen coordinates
for positioning.

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if the window will always be positioned in screen coordinates. <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#setIsLaidOutInScreen(boolean)`

### isOutsideTouchable

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isOutsideTouchable ()
```

<br />

Indicates whether the popup window will be informed of touch events
outside of its window.

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if the popup is outside touchable, false otherwise <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#setOutsideTouchable(boolean)`

### isShowing

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isShowing ()
```

<br />

Indicate whether this popup window is showing on screen.

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if the popup is showing, false otherwise <br /> |

### isSplitTouchEnabled

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isSplitTouchEnabled ()
```

<br />

Indicates whether the popup window supports splitting touches.

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if the touch splitting is enabled, false otherwise <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#setSplitTouchEnabled(boolean)`

### isTouchModal

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isTouchModal ()
```

<br />

Indicates whether outside touches will be sent to this window
or other windows behind it

<br />

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if touches will be sent to this window, false otherwise <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#setTouchModal(boolean)`

### isTouchable

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isTouchable ()
```

<br />

Indicates whether the popup window receives touch events.

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if the popup is touchable, false otherwise <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#setTouchable(boolean)`

### setAnimationStyle

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setAnimationStyle (int animationStyle)
```

<br />

Change the animation style resource for this popup.

If the popup is showing, calling this method will take effect only
the next time the popup is shown or through a manual call to one of
the `https://developer.android.com/reference/android/widget/PopupWindow#update()` methods.

<br />

<br />

| Parameters ||
|---|---|
| `animationStyle` | `int`: animation style to use when the popup appears and disappears. Set to -1 for the default animation, 0 for no animation, or a resource identifier for an explicit animation. <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#update()`

### setAttachedInDecor

Added in [API level 22](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setAttachedInDecor (boolean enabled)
```

<br />

This will attach the popup window to the decor frame of the parent window to avoid
overlaping with screen decorations like the navigation bar. Overrides the default behavior of
the flag `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#FLAG_LAYOUT_ATTACHED_IN_DECOR`.

By default the flag is set on SDK version `https://developer.android.com/reference/android/os/Build.VERSION_CODES#LOLLIPOP_MR1` or
greater and cleared on lesser SDK versions.

<br />

| Parameters ||
|---|---|
| `enabled` | `boolean`: true if the popup should be attached to the decor frame of its parent window. <br /> |

**See also:**

- `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#FLAG_LAYOUT_ATTACHED_IN_DECOR`

### setBackgroundDrawable

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setBackgroundDrawable (Drawable background)
```

Specifies the background drawable for this popup window. The background
can be set to `null`.

<br />

**Related XML Attributes:**

- [android:popupBackground](https://developer.android.com/reference/android/widget/PopupWindow#attr_android:popupBackground)

| Parameters ||
|---|---|
| `background` | `Drawable`: the popup's background <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#getBackground()`

### setClippingEnabled

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setClippingEnabled (boolean enabled)
```

<br />

Allows the popup window to extend beyond the bounds of the screen. By default the
window is clipped to the screen boundaries. Setting this to false will allow windows to be
accurately positioned.

If the popup is showing, calling this method will take effect only
the next time the popup is shown or through a manual call to one of
the `https://developer.android.com/reference/android/widget/PopupWindow#update()` methods.

<br />

<br />

| Parameters ||
|---|---|
| `enabled` | `boolean`: false if the window should be allowed to extend outside of the screen <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#isShowing()`
- `https://developer.android.com/reference/android/widget/PopupWindow#isClippingEnabled()`
- `https://developer.android.com/reference/android/widget/PopupWindow#update()`

### setContentView

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setContentView (View contentView)
```

<br />

Change the popup's content. The content is represented by an instance
of `https://developer.android.com/reference/android/view/View`.

This method has no effect if called when the popup is showing.

<br />

<br />

| Parameters ||
|---|---|
| `contentView` | `View`: the new content for the popup <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#getContentView()`
- `https://developer.android.com/reference/android/widget/PopupWindow#isShowing()`

### setElevation

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setElevation (float elevation)
```

Specifies the elevation for this popup window.

<br />

**Related XML Attributes:**

- [android:popupElevation](https://developer.android.com/reference/android/widget/PopupWindow#attr_android:popupElevation)

| Parameters ||
|---|---|
| `elevation` | `float`: the popup's elevation in pixels <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#getElevation()`

### setEnterTransition

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setEnterTransition (Transition enterTransition)
```

Sets the enter transition to be used when the popup window is shown.

<br />

**Related XML Attributes:**

- [android:popupEnterTransition](https://developer.android.com/reference/android/widget/PopupWindow#attr_android:popupEnterTransition)

| Parameters ||
|---|---|
| `enterTransition` | `Transition`: the enter transition, or `null` to clear <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#getEnterTransition()`

### setEpicenterBounds

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setEpicenterBounds (Rect bounds)
```

<br />

Sets the bounds used as the epicenter of the enter and exit transitions.

Transitions use Rect, referred to as the epicenter, to orient
the direction of travel. For popup windows, the anchor view bounds are
used as the default epicenter.

See `https://developer.android.com/reference/android/transition/Transition#setEpicenterCallback(android.transition.Transition.EpicenterCallback)` for more
information about how transition epicenters work.

<br />

<br />

| Parameters ||
|---|---|
| `bounds` | `Rect`: the epicenter bounds relative to the anchor view, or `null` to use the default epicenter <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#getEpicenterBounds()`

### setExitTransition

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setExitTransition (Transition exitTransition)
```

Sets the exit transition to be used when the popup window is dismissed.

<br />

**Related XML Attributes:**

- [android:popupExitTransition](https://developer.android.com/reference/android/widget/PopupWindow#attr_android:popupExitTransition)

| Parameters ||
|---|---|
| `exitTransition` | `Transition`: the exit transition, or `null` to clear <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#getExitTransition()`

### setFocusable

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setFocusable (boolean focusable)
```

<br />

Changes the focusability of the popup window. When focusable, the
window will grab the focus from the current focused widget if the popup
contains a focusable `https://developer.android.com/reference/android/view/View`. By default a popup
window is not focusable.

If the popup is showing, calling this method will take effect only
the next time the popup is shown or through a manual call to one of
the `https://developer.android.com/reference/android/widget/PopupWindow#update()` methods.

<br />

<br />

| Parameters ||
|---|---|
| `focusable` | `boolean`: true if the popup should grab focus, false otherwise. <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#isFocusable()`
- `https://developer.android.com/reference/android/widget/PopupWindow#isShowing()`
- `https://developer.android.com/reference/android/widget/PopupWindow#update()`

### setHeight

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setHeight (int height)
```

Sets the popup's requested height. May be a layout constant such as
`https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#WRAP_CONTENT` or `https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#MATCH_PARENT`.


The actual size of the popup may depend on other factors such as
clipping and window layout.


If the popup is showing, calling this method will take effect the next
time the popup is shown.

<br />

| Parameters ||
|---|---|
| `height` | `int`: the popup height in pixels or a layout constant <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#getHeight()`
- `https://developer.android.com/reference/android/widget/PopupWindow#isShowing()`

### setIgnoreCheekPress

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setIgnoreCheekPress ()
```

Set the flag on popup to ignore cheek press events; by default this flag
is set to false
which means the popup will not ignore cheek press dispatch events.

If the popup is showing, calling this method will take effect only
the next time the popup is shown or through a manual call to one of
the `https://developer.android.com/reference/android/widget/PopupWindow#update()` methods.

<br />

<br />

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#update()`

### setInputMethodMode

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setInputMethodMode (int mode)
```

Control how the popup operates with an input method: one of
`https://developer.android.com/reference/android/widget/PopupWindow#INPUT_METHOD_FROM_FOCUSABLE`, `https://developer.android.com/reference/android/widget/PopupWindow#INPUT_METHOD_NEEDED`,
or `https://developer.android.com/reference/android/widget/PopupWindow#INPUT_METHOD_NOT_NEEDED`.

If the popup is showing, calling this method will take effect only
the next time the popup is shown or through a manual call to one of
the `https://developer.android.com/reference/android/widget/PopupWindow#update()` methods.

<br />

<br />

| Parameters ||
|---|---|
| `mode` | `int` <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#getInputMethodMode()`
- `https://developer.android.com/reference/android/widget/PopupWindow#update()`

### setIsClippedToScreen

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setIsClippedToScreen (boolean enabled)
```

<br />

Clip this popup window to the screen, but not to the containing window.

If the popup is showing, calling this method will take effect only
the next time the popup is shown or through a manual call to one of
the `https://developer.android.com/reference/android/widget/PopupWindow#update()` methods.

<br />

<br />

| Parameters ||
|---|---|
| `enabled` | `boolean`: true to clip to the screen. <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#isClippedToScreen()`

### setIsLaidOutInScreen

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setIsLaidOutInScreen (boolean enabled)
```

<br />

Allows the popup window to force the flag
`https://developer.android.com/reference/android/view/WindowManager.LayoutParams#FLAG_LAYOUT_IN_SCREEN`, overriding default behavior.
This will cause the popup to be positioned in absolute screen coordinates.

<br />

<br />

| Parameters ||
|---|---|
| `enabled` | `boolean`: true if the popup should always be positioned in screen coordinates <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#isLaidOutInScreen()`

### setOnDismissListener

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setOnDismissListener (PopupWindow.OnDismissListener onDismissListener)
```

Sets the listener to be called when the window is dismissed.

<br />

| Parameters ||
|---|---|
| `onDismissListener` | `PopupWindow.OnDismissListener`: The listener. <br /> |

### setOutsideTouchable

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setOutsideTouchable (boolean touchable)
```

<br />

Controls whether the pop-up will be informed of touch events outside
of its window. This only makes sense for pop-ups that are touchable
but not focusable, which means touches outside of the window will
be delivered to the window behind. The default is false.

If the popup is showing, calling this method will take effect only
the next time the popup is shown or through a manual call to one of
the `https://developer.android.com/reference/android/widget/PopupWindow#update()` methods.

<br />

<br />

| Parameters ||
|---|---|
| `touchable` | `boolean`: true if the popup should receive outside touch events, false otherwise <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#isOutsideTouchable()`
- `https://developer.android.com/reference/android/widget/PopupWindow#isShowing()`
- `https://developer.android.com/reference/android/widget/PopupWindow#update()`

### setOverlapAnchor

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setOverlapAnchor (boolean overlapAnchor)
```

Sets whether the popup window should overlap its anchor view when
displayed as a drop-down.


If the popup is showing, calling this method will take effect only
the next time the popup is shown.

<br />

| Parameters ||
|---|---|
| `overlapAnchor` | `boolean`: Whether the popup should overlap its anchor. <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#getOverlapAnchor()`
- `https://developer.android.com/reference/android/widget/PopupWindow#isShowing()`

### setSoftInputMode

Added in [API level 4](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setSoftInputMode (int mode)
```

Sets the operating mode for the soft input area.

<br />

| Parameters ||
|---|---|
| `mode` | `int`: The desired mode, see `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#softInputMode` for the full list. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#SOFT_INPUT_STATE_UNSPECIFIED` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#SOFT_INPUT_STATE_UNCHANGED` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#SOFT_INPUT_STATE_HIDDEN` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#SOFT_INPUT_STATE_ALWAYS_HIDDEN` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#SOFT_INPUT_STATE_VISIBLE` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#SOFT_INPUT_STATE_ALWAYS_VISIBLE` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#SOFT_INPUT_ADJUST_UNSPECIFIED` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#SOFT_INPUT_ADJUST_RESIZE` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#SOFT_INPUT_ADJUST_PAN` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#SOFT_INPUT_ADJUST_NOTHING` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#SOFT_INPUT_IS_FORWARD_NAVIGATION` |

**See also:**

- `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#softInputMode`
- `https://developer.android.com/reference/android/widget/PopupWindow#getSoftInputMode()`

### setSplitTouchEnabled

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setSplitTouchEnabled (boolean enabled)
```

<br />

Allows the popup window to split touches across other windows that also
support split touch. When this flag is false, the first pointer
that goes down determines the window to which all subsequent touches
go until all pointers go up. When this flag is true, each pointer
(not necessarily the first) that goes down determines the window
to which all subsequent touches of that pointer will go until that
pointer goes up thereby enabling touches with multiple pointers
to be split across multiple windows.

<br />

<br />

| Parameters ||
|---|---|
| `enabled` | `boolean`: true if the split touches should be enabled, false otherwise <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#isSplitTouchEnabled()`

### setTouchInterceptor

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setTouchInterceptor (View.OnTouchListener l)
```

Set a callback for all touch events being dispatched to the popup
window.

<br />

| Parameters ||
|---|---|
| `l` | `View.OnTouchListener` <br /> |

### setTouchModal

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setTouchModal (boolean touchModal)
```

<br />

Set whether this window is touch modal or if outside touches will be sent to
other windows behind it.

<br />

If the popup is showing, calling this method will take effect only
the next time the popup is shown or through a manual call to one of
the `https://developer.android.com/reference/android/widget/PopupWindow#update()` methods.

<br />

<br />

| Parameters ||
|---|---|
| `touchModal` | `boolean`: true to sent all outside touches to this window, false to other windows behind it <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#isTouchModal()`

### setTouchable

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setTouchable (boolean touchable)
```

<br />

Changes the touchability of the popup window. When touchable, the
window will receive touch events, otherwise touch events will go to the
window below it. By default the window is touchable.

If the popup is showing, calling this method will take effect only
the next time the popup is shown or through a manual call to one of
the `https://developer.android.com/reference/android/widget/PopupWindow#update()` methods.

<br />

<br />

| Parameters ||
|---|---|
| `touchable` | `boolean`: true if the popup should receive touch events, false otherwise <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#isTouchable()`
- `https://developer.android.com/reference/android/widget/PopupWindow#isShowing()`
- `https://developer.android.com/reference/android/widget/PopupWindow#update()`

### setWidth

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setWidth (int width)
```

Sets the popup's requested width. May be a layout constant such as
`https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#WRAP_CONTENT` or `https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#MATCH_PARENT`.


The actual size of the popup may depend on other factors such as
clipping and window layout.


If the popup is showing, calling this method will take effect the next
time the popup is shown.

<br />

| Parameters ||
|---|---|
| `width` | `int`: the popup width in pixels or a layout constant <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#getWidth()`
- `https://developer.android.com/reference/android/widget/PopupWindow#isShowing()`

### setWindowLayoutMode

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setWindowLayoutMode (int widthSpec, 
                int heightSpec)
```


**This method was deprecated
in API level 23.**   

Use `https://developer.android.com/reference/android/widget/PopupWindow#setWidth(int)` and `https://developer.android.com/reference/android/widget/PopupWindow#setHeight(int)`.

<br />

Change the width and height measure specs that are given to the
window manager by the popup. By default these are 0, meaning that
the current width or height is requested as an explicit size from
the window manager. You can supply
`https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#WRAP_CONTENT` or
`https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#MATCH_PARENT` to have that measure
spec supplied instead, replacing the absolute width and height that
has been set in the popup.

If the popup is showing, calling this method will take effect only
the next time the popup is shown.

<br />

<br />

| Parameters ||
|---|---|
| `widthSpec` | `int`: an explicit width measure spec mode, either `https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#WRAP_CONTENT`, `https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#MATCH_PARENT`, or 0 to use the absolute width. <br /> |
| `heightSpec` | `int`: an explicit height measure spec mode, either `https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#WRAP_CONTENT`, `https://developer.android.com/reference/android/view/ViewGroup.LayoutParams#MATCH_PARENT`, or 0 to use the absolute height. <br /> |

### setWindowLayoutType

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setWindowLayoutType (int layoutType)
```

Set the layout type for this window.


See `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#type` for possible values.

<br />

| Parameters ||
|---|---|
| `layoutType` | `int`: Layout type for this window. <br /> |

**See also:**

- `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#type`

### showAsDropDown

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void showAsDropDown (View anchor)
```

Display the content view in a popup window anchored to the bottom-left
corner of the anchor view. If there is not enough room on screen to show
the popup in its entirety, this method tries to find a parent scroll
view to scroll. If no parent scroll view can be scrolled, the
bottom-left corner of the popup is pinned at the top left corner of the
anchor view.

<br />

| Parameters ||
|---|---|
| `anchor` | `View`: the view on which to pin the popup window <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#dismiss()`

### showAsDropDown

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void showAsDropDown (View anchor, 
                int xoff, 
                int yoff, 
                int gravity)
```

Displays the content view in a popup window anchored to the corner of
another view. The window is positioned according to the specified
gravity and offset by the specified x and y coordinates.


If there is not enough room on screen to show the popup in its entirety,
this method tries to find a parent scroll view to scroll. If no parent
view can be scrolled, the specified vertical gravity will be ignored and
the popup will anchor itself such that it is visible.


If the view later scrolls to move `anchor` to a different
location, the popup will be moved correspondingly.

<br />

| Parameters ||
|---|---|
| `anchor` | `View`: the view on which to pin the popup window <br /> |
| `xoff` | `int`: A horizontal offset from the anchor in pixels <br /> |
| `yoff` | `int`: A vertical offset from the anchor in pixels <br /> |
| `gravity` | `int`: Alignment of the popup relative to the anchor <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#dismiss()`

### showAsDropDown

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void showAsDropDown (View anchor, 
                int xoff, 
                int yoff)
```

Display the content view in a popup window anchored to the bottom-left
corner of the anchor view offset by the specified x and y coordinates.
If there is not enough room on screen to show the popup in its entirety,
this method tries to find a parent scroll view to scroll. If no parent
scroll view can be scrolled, the bottom-left corner of the popup is
pinned at the top left corner of the anchor view.


If the view later scrolls to move `anchor` to a different
location, the popup will be moved correspondingly.

<br />

| Parameters ||
|---|---|
| `anchor` | `View`: the view on which to pin the popup window <br /> |
| `xoff` | `int`: A horizontal offset from the anchor in pixels <br /> |
| `yoff` | `int`: A vertical offset from the anchor in pixels <br /> |

**See also:**

- `https://developer.android.com/reference/android/widget/PopupWindow#dismiss()`

### showAtLocation

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void showAtLocation (View parent, 
                int gravity, 
                int x, 
                int y)
```

<br />


Display the content view in a popup window at the specified location. If the popup window
cannot fit on screen, it will be clipped. See `https://developer.android.com/reference/android/view/WindowManager.LayoutParams`
for more information on how gravity and the x and y parameters are related. Specifying
a gravity of `https://developer.android.com/reference/android/view/Gravity#NO_GRAVITY` is similar to specifying
`Gravity.LEFT | Gravity.TOP`.

<br />

<br />

| Parameters ||
|---|---|
| `parent` | `View`: a parent view to get the `https://developer.android.com/reference/android/view/View#getWindowToken()` token from <br /> |
| `gravity` | `int`: the gravity which controls the placement of the popup window <br /> |
| `x` | `int`: the popup's x location offset <br /> |
| `y` | `int`: the popup's y location offset <br /> |

### update

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void update (View anchor, 
                int width, 
                int height)
```

Updates the position and the dimension of the popup window.


Calling this function also updates the window with the current popup
state as described for `https://developer.android.com/reference/android/widget/PopupWindow#update()`.

<br />

| Parameters ||
|---|---|
| `anchor` | `View`: the popup's anchor view <br /> |
| `width` | `int`: the new width in pixels, must be \>= 0 or -1 to ignore <br /> |
| `height` | `int`: the new height in pixels, must be \>= 0 or -1 to ignore <br /> |

### update

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void update (View anchor, 
                int xoff, 
                int yoff, 
                int width, 
                int height)
```

Updates the position and the dimension of the popup window.


Width and height can be set to -1 to update location only. Calling this
function also updates the window with the current popup state as
described for `https://developer.android.com/reference/android/widget/PopupWindow#update()`.


If the view later scrolls to move `anchor` to a different
location, the popup will be moved correspondingly.

<br />

| Parameters ||
|---|---|
| `anchor` | `View`: the popup's anchor view <br /> |
| `xoff` | `int`: x offset from the view's left edge <br /> |
| `yoff` | `int`: y offset from the view's bottom edge <br /> |
| `width` | `int`: the new width in pixels, must be \>= 0 or -1 to ignore <br /> |
| `height` | `int`: the new height in pixels, must be \>= 0 or -1 to ignore <br /> |

### update

Added in [API level 4](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void update (int width, 
                int height)
```

Updates the dimension of the popup window.


Calling this function also updates the window with the current popup
state as described for `https://developer.android.com/reference/android/widget/PopupWindow#update()`.

<br />

| Parameters ||
|---|---|
| `width` | `int`: the new width in pixels, must be \>= 0 or -1 to ignore <br /> |
| `height` | `int`: the new height in pixels, must be \>= 0 or -1 to ignore <br /> |

### update

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void update ()
```

Updates the state of the popup window, if it is currently being displayed,
from the currently set state.


This includes:

- `https://developer.android.com/reference/android/widget/PopupWindow#setClippingEnabled(boolean)`
- `https://developer.android.com/reference/android/widget/PopupWindow#setFocusable(boolean)`
- `https://developer.android.com/reference/android/widget/PopupWindow#setIgnoreCheekPress()`
- `https://developer.android.com/reference/android/widget/PopupWindow#setInputMethodMode(int)`
- `https://developer.android.com/reference/android/widget/PopupWindow#setTouchable(boolean)`
- `https://developer.android.com/reference/android/widget/PopupWindow#setAnimationStyle(int)`
- `https://developer.android.com/reference/android/widget/PopupWindow#setTouchModal(boolean)` (boolean)}
- `https://developer.android.com/reference/android/widget/PopupWindow#setIsClippedToScreen(boolean)`

<br />

<br />

### update

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void update (int x, 
                int y, 
                int width, 
                int height, 
                boolean force)
```

Updates the position and the dimension of the popup window.


Width and height can be set to -1 to update location only. Calling this
function also updates the window with the current popup state as
described for `https://developer.android.com/reference/android/widget/PopupWindow#update()`.

<br />

| Parameters ||
|---|---|
| `x` | `int`: the new x location <br /> |
| `y` | `int`: the new y location <br /> |
| `width` | `int`: the new width in pixels, must be \>= 0 or -1 to ignore <br /> |
| `height` | `int`: the new height in pixels, must be \>= 0 or -1 to ignore <br /> |
| `force` | `boolean`: `true` to reposition the window even if the specified position already seems to correspond to the LayoutParams, `false` to only reposition if needed <br /> |

### update

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void update (int x, 
                int y, 
                int width, 
                int height)
```

Updates the position and the dimension of the popup window.


Width and height can be set to -1 to update location only. Calling this
function also updates the window with the current popup state as
described for `https://developer.android.com/reference/android/widget/PopupWindow#update()`.

<br />

| Parameters ||
|---|---|
| `x` | `int`: the new x location <br /> |
| `y` | `int`: the new y location <br /> |
| `width` | `int`: the new width in pixels, must be \>= 0 or -1 to ignore <br /> |
| `height` | `int`: the new height in pixels, must be \>= 0 or -1 to ignore <br /> |