Added in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#pubctors) \| [Methods](https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#inhmethods)

# AccessibilityRecord

*** ** * ** ***

` public class AccessibilityRecord `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.view.accessibility.AccessibilityRecord |

Known direct subclasses [AccessibilityEvent](https://developer.android.com/reference/android/view/accessibility/AccessibilityEvent) [AccessibilityEvent](https://developer.android.com/reference/android/view/accessibility/AccessibilityEvent) This class represents accessibility events that are sent by the system when something notable happens in the user interface.

*** ** * ** ***

Represents a record in an `https://developer.android.com/reference/android/view/accessibility/AccessibilityEvent` and contains information about state change of its source `https://developer.android.com/reference/android/view/View`. When a view fires an accessibility event it requests from its parent to dispatch the constructed event. The parent may optionally append a record for itself for providing more context to `https://developer.android.com/reference/android/accessibilityservice/AccessibilityService`s. Hence, accessibility services can facilitate additional accessibility records to enhance feedback.

Once the accessibility event containing a record is dispatched the record is made immutable and calling a state mutation method generates an error.

**Note:** Not all properties are applicable to all accessibility event types. For detailed information please refer to `https://developer.android.com/reference/android/view/accessibility/AccessibilityEvent`.

### Developer Guides

For more information about creating and processing AccessibilityRecords, read the [Accessibility](https://developer.android.com/guide/topics/ui/accessibility) developer guide.

<br />

**See also:**

- `https://developer.android.com/reference/android/view/accessibility/AccessibilityEvent`
- `https://developer.android.com/reference/android/view/accessibility/AccessibilityManager`
- `https://developer.android.com/reference/android/accessibilityservice/AccessibilityService`
- `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo`

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#AccessibilityRecord()() ` Creates a new `https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord`. |
| ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#AccessibilityRecord(android.view.accessibility.AccessibilityRecord)(https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord record) ` Copy constructor. |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#getAddedCount()() ` Gets the number of added characters. |
| ` https://developer.android.com/reference/java/lang/CharSequence` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#getBeforeText()() ` Gets the text before a change. |
| ` https://developer.android.com/reference/java/lang/CharSequence` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#getClassName()() ` Gets the class name of the source. |
| ` https://developer.android.com/reference/java/lang/CharSequence` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#getContentDescription()() ` Gets the description of the source. |
| ` int` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#getCurrentItemIndex()() ` Gets the index of the source in the list of items the can be visited. |
| ` int` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#getDisplayId()() ` Gets the id of the display from which the event comes from. |
| ` int` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#getFromIndex()() ` Gets the index of the first character of the changed sequence, or the beginning of a text selection or the index of the first visible item when scrolling. |
| ` int` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#getItemCount()() ` Gets the number of items that can be visited. |
| ` int` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#getMaxScrollX()() ` Gets the max scroll offset of the source left edge in pixels. |
| ` int` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#getMaxScrollY()() ` Gets the max scroll offset of the source top edge in pixels. |
| ` https://developer.android.com/reference/android/os/Parcelable` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#getParcelableData()() ` Gets the `https://developer.android.com/reference/android/os/Parcelable` data. |
| ` int` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#getRemovedCount()() ` Gets the number of removed characters. |
| ` int` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#getScrollDeltaX()() ` Gets the difference in pixels between the horizontal position before the scroll and the current horizontal position |
| ` int` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#getScrollDeltaY()() ` Gets the difference in pixels between the vertical position before the scroll and the current vertical position |
| ` int` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#getScrollX()() ` Gets the scroll offset of the source left edge in pixels. |
| ` int` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#getScrollY()() ` Gets the scroll offset of the source top edge in pixels. |
| ` https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#getSource()() ` Gets the `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo` of the event source. |
| ` https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#getSource(int)(int prefetchingStrategy) ` Gets the `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo` of the event source. |
| ` https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/java/lang/CharSequence>` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#getText()() ` Gets the text of the event. |
| ` int` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#getToIndex()() ` Gets the index of text selection end or the index of the last visible item when scrolling. |
| ` int` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#getWindowId()() ` Returns the id of the window that sent this event, or owns UI that sent this event. |
| ` boolean` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#isChecked()() ` Gets if the source is checked. |
| ` boolean` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#isEnabled()() ` Gets if the source is enabled. |
| ` boolean` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#isFullScreen()() ` Gets if the source is taking the entire screen. |
| ` boolean` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#isPassword()() ` Gets if the source is a password field. |
| ` boolean` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#isScrollable()() ` Gets if the source is scrollable. |
| ` static https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#obtain(android.view.accessibility.AccessibilityRecord)(https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord record) ` *This method was deprecated in API level 33. Object pooling has been discontinued. Create a new instance using the constructor `https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#AccessibilityRecord()` instead.* |
| ` static https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#obtain()() ` *This method was deprecated in API level 33. Object pooling has been discontinued. Create a new instance using the constructor `https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#AccessibilityRecord()` instead.* |
| ` void` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#recycle()() ` *This method was deprecated in API level 33. Object pooling has been discontinued. Calling this function now will have no effect.* |
| ` void` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#setAddedCount(int)(int addedCount) ` Sets the number of added characters. |
| ` void` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#setBeforeText(java.lang.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence beforeText) ` Sets the text before a change. |
| ` void` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#setChecked(boolean)(boolean isChecked) ` Sets if the source is checked. |
| ` void` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#setClassName(java.lang.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence className) ` Sets the class name of the source. |
| ` void` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#setContentDescription(java.lang.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence contentDescription) ` Sets the description of the source. |
| ` void` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#setCurrentItemIndex(int)(int currentItemIndex) ` Sets the index of the source in the list of items that can be visited. |
| ` void` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#setEnabled(boolean)(boolean isEnabled) ` Sets if the source is enabled. |
| ` void` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#setFromIndex(int)(int fromIndex) ` Sets the index of the first character of the changed sequence or the beginning of a text selection or the index of the first visible item when scrolling. |
| ` void` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#setFullScreen(boolean)(boolean isFullScreen) ` Sets if the source is taking the entire screen. |
| ` void` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#setItemCount(int)(int itemCount) ` Sets the number of items that can be visited. |
| ` void` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#setMaxScrollX(int)(int maxScrollX) ` Sets the max scroll offset of the source left edge in pixels. |
| ` void` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#setMaxScrollY(int)(int maxScrollY) ` Sets the max scroll offset of the source top edge in pixels. |
| ` void` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#setParcelableData(android.os.Parcelable)(https://developer.android.com/reference/android/os/Parcelable parcelableData) ` Sets the `https://developer.android.com/reference/android/os/Parcelable` data of the event. |
| ` void` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#setPassword(boolean)(boolean isPassword) ` Sets if the source is a password field. |
| ` void` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#setRemovedCount(int)(int removedCount) ` Sets the number of removed characters. |
| ` void` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#setScrollDeltaX(int)(int scrollDeltaX) ` Sets the difference in pixels between the horizontal position before the scroll and the current horizontal position |
| ` void` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#setScrollDeltaY(int)(int scrollDeltaY) ` Sets the difference in pixels between the vertical position before the scroll and the current vertical position |
| ` void` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#setScrollX(int)(int scrollX) ` Sets the scroll offset of the source left edge in pixels. |
| ` void` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#setScrollY(int)(int scrollY) ` Sets the scroll offset of the source top edge in pixels. |
| ` void` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#setScrollable(boolean)(boolean scrollable) ` Sets if the source is scrollable. |
| ` void` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#setSource(android.view.View,%20int)(https://developer.android.com/reference/android/view/View root, int virtualDescendantId) ` Sets the source to be a virtual descendant of the given `root`. |
| ` void` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#setSource(android.view.View)(https://developer.android.com/reference/android/view/View source) ` Sets the event source. |
| ` void` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#setToIndex(int)(int toIndex) ` Sets the index of text selection end or the index of the last visible item when scrolling. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#toString()() ` Returns a string representation of the object. |

### 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*.

## Public constructors

### AccessibilityRecord

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

```
public AccessibilityRecord ()
```

Creates a new `https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord`.

<br />

### AccessibilityRecord

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

```
public AccessibilityRecord (AccessibilityRecord record)
```

Copy constructor. Creates a new `https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord`, and this instance is initialized with data from the given `record`.

<br />

| Parameters ||
|---|---|
| `record` | `AccessibilityRecord`: The other record. This value cannot be `null`. <br /> |

## Public methods

### getAddedCount

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

```
public int getAddedCount ()
```

Gets the number of added characters.

<br />

| Returns ||
|---|---|
| `int` | The number of added characters. <br /> |

### getBeforeText

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

```
public CharSequence getBeforeText ()
```

Gets the text before a change.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/CharSequence` | The text before the change. This value may be `null`. <br /> |

### getClassName

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

```
public CharSequence getClassName ()
```

Gets the class name of the source.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/CharSequence` | The class name. This value may be `null`. <br /> |

### getContentDescription

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

```
public CharSequence getContentDescription ()
```

Gets the description of the source.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/CharSequence` | The description. This value may be `null`. <br /> |

### getCurrentItemIndex

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

```
public int getCurrentItemIndex ()
```

Gets the index of the source in the list of items the can be visited.

<br />

| Returns ||
|---|---|
| `int` | The current item index. <br /> |

### getDisplayId

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

```
public int getDisplayId ()
```

Gets the id of the display from which the event comes from.

<br />

| Returns ||
|---|---|
| `int` | The display id. <br /> |

### getFromIndex

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

```
public int getFromIndex ()
```

Gets the index of the first character of the changed sequence, or the beginning of a text selection or the index of the first visible item when scrolling.

<br />

| Returns ||
|---|---|
| `int` | The index of the first character or selection start or the first visible item. <br /> |

### getItemCount

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

```
public int getItemCount ()
```

Gets the number of items that can be visited.

<br />

| Returns ||
|---|---|
| `int` | The number of items. <br /> |

### getMaxScrollX

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

```
public int getMaxScrollX ()
```

Gets the max scroll offset of the source left edge in pixels.

<br />

| Returns ||
|---|---|
| `int` | The max scroll. <br /> |

### getMaxScrollY

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

```
public int getMaxScrollY ()
```

Gets the max scroll offset of the source top edge in pixels.

<br />

| Returns ||
|---|---|
| `int` | The max scroll. <br /> |

### getParcelableData

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

```
public Parcelable getParcelableData ()
```

Gets the `https://developer.android.com/reference/android/os/Parcelable` data.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/Parcelable` | The parcelable data. This value may be `null`. <br /> |

### getRemovedCount

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

```
public int getRemovedCount ()
```

Gets the number of removed characters.

<br />

| Returns ||
|---|---|
| `int` | The number of removed characters. <br /> |

### getScrollDeltaX

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

```
public int getScrollDeltaX ()
```

Gets the difference in pixels between the horizontal position before the scroll and the current horizontal position

<br />

| Returns ||
|---|---|
| `int` | the scroll delta x <br /> |

### getScrollDeltaY

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

```
public int getScrollDeltaY ()
```

Gets the difference in pixels between the vertical position before the scroll and the current vertical position

<br />

| Returns ||
|---|---|
| `int` | the scroll delta y <br /> |

### getScrollX

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

```
public int getScrollX ()
```

Gets the scroll offset of the source left edge in pixels.

<br />

| Returns ||
|---|---|
| `int` | The scroll. <br /> |

### getScrollY

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

```
public int getScrollY ()
```

Gets the scroll offset of the source top edge in pixels.

<br />

| Returns ||
|---|---|
| `int` | The scroll. <br /> |

### getSource

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

```
public AccessibilityNodeInfo getSource ()
```

Gets the `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo` of the event source.

**Note:** It is a client responsibility to recycle the received info by calling `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo#recycle()` to avoid creating of multiple instances.

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo` | The info of the source. This value may be `null`. <br /> |

### getSource

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

```
public AccessibilityNodeInfo getSource (int prefetchingStrategy)
```

Gets the `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo` of the event source.

<br />

| Parameters ||
|---|---|
| `prefetchingStrategy` | `int`: the prefetching strategy. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo#FLAG_PREFETCH_ANCESTORS` - `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo#FLAG_PREFETCH_SIBLINGS` - `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo#FLAG_PREFETCH_DESCENDANTS_HYBRID` - `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo#FLAG_PREFETCH_DESCENDANTS_DEPTH_FIRST` - `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo#FLAG_PREFETCH_DESCENDANTS_BREADTH_FIRST` - `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo#FLAG_PREFETCH_UNINTERRUPTIBLE` |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo` | The info of the source. This value may be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo#getParent(int)`

### getText

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

```
public List<CharSequence> getText ()
```

Gets the text of the event. The index in the list represents the priority of the text. Specifically, the lower the index the higher the priority.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/java/lang/CharSequence>` | The text. This value cannot be `null`. <br /> |

### getToIndex

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

```
public int getToIndex ()
```

Gets the index of text selection end or the index of the last visible item when scrolling.

<br />

| Returns ||
|---|---|
| `int` | The index of selection end or last item index. <br /> |

### getWindowId

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

```
public int getWindowId ()
```

Returns the id of the window that sent this event, or owns UI that sent this event.

**Note:** If this event comes from a window that is embedded in another window using `https://developer.android.com/reference/android/view/SurfaceView` then the return value is the id of the window that embeds this event's window.

<br />

| Returns ||
|---|---|
| `int` | The window id. <br /> |

### isChecked

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

```
public boolean isChecked ()
```

Gets if the source is checked.

<br />

| Returns ||
|---|---|
| `boolean` | True if the view is checked, false otherwise. <br /> |

### isEnabled

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

```
public boolean isEnabled ()
```

Gets if the source is enabled.

<br />

| Returns ||
|---|---|
| `boolean` | True if the view is enabled, false otherwise. <br /> |

### isFullScreen

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

```
public boolean isFullScreen ()
```

Gets if the source is taking the entire screen.

<br />

| Returns ||
|---|---|
| `boolean` | True if the source is full screen, false otherwise. <br /> |

### isPassword

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

```
public boolean isPassword ()
```

Gets if the source is a password field.

<br />

| Returns ||
|---|---|
| `boolean` | True if the view is a password field, false otherwise. <br /> |

### isScrollable

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

```
public boolean isScrollable ()
```

Gets if the source is scrollable.

<br />

| Returns ||
|---|---|
| `boolean` | True if the source is scrollable, false otherwise. <br /> |

### obtain

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

```
public static AccessibilityRecord obtain (AccessibilityRecord record)
```

<br />

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

Object pooling has been discontinued. Create a new instance using the constructor `https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#AccessibilityRecord()` instead.

Instantiates a new record initialized with data from the given record.

<br />

| Parameters ||
|---|---|
| `record` | `AccessibilityRecord`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord` | An instance. This value cannot be `null`. <br /> |

### obtain

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

```
public static AccessibilityRecord obtain ()
```

<br />

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

Object pooling has been discontinued. Create a new instance using the constructor `https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord#AccessibilityRecord()` instead.

Instantiates a new record.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord` | An instance. This value cannot be `null`. <br /> |

### recycle

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

```
public void recycle ()
```

<br />

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

Object pooling has been discontinued. Calling this function now will have no effect.

Would previously return an instance back to be reused.

<br />

### setAddedCount

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

```
public void setAddedCount (int addedCount)
```

Sets the number of added characters.

<br />

| Parameters ||
|---|---|
| `addedCount` | `int`: The number of added characters. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | If called from an AccessibilityService. |

### setBeforeText

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

```
public void setBeforeText (CharSequence beforeText)
```

Sets the text before a change.

<br />

| Parameters ||
|---|---|
| `beforeText` | `CharSequence`: The text before the change. This value may be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | If called from an AccessibilityService. |

### setChecked

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

```
public void setChecked (boolean isChecked)
```

Sets if the source is checked.

<br />

| Parameters ||
|---|---|
| `isChecked` | `boolean`: True if the view is checked, false otherwise. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | If called from an AccessibilityService. |

### setClassName

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

```
public void setClassName (CharSequence className)
```

Sets the class name of the source.

<br />

| Parameters ||
|---|---|
| `className` | `CharSequence`: The lass name. This value may be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | If called from an AccessibilityService. |

### setContentDescription

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

```
public void setContentDescription (CharSequence contentDescription)
```

Sets the description of the source.

<br />

| Parameters ||
|---|---|
| `contentDescription` | `CharSequence`: The description. This value may be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | If called from an AccessibilityService. |

### setCurrentItemIndex

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

```
public void setCurrentItemIndex (int currentItemIndex)
```

Sets the index of the source in the list of items that can be visited.

<br />

| Parameters ||
|---|---|
| `currentItemIndex` | `int`: The current item index. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | If called from an AccessibilityService. |

### setEnabled

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

```
public void setEnabled (boolean isEnabled)
```

Sets if the source is enabled.

<br />

| Parameters ||
|---|---|
| `isEnabled` | `boolean`: True if the view is enabled, false otherwise. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | If called from an AccessibilityService. |

### setFromIndex

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

```
public void setFromIndex (int fromIndex)
```

Sets the index of the first character of the changed sequence or the beginning of a text selection or the index of the first visible item when scrolling.

<br />

| Parameters ||
|---|---|
| `fromIndex` | `int`: The index of the first character or selection start or the first visible item. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | If called from an AccessibilityService. |

### setFullScreen

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

```
public void setFullScreen (boolean isFullScreen)
```

Sets if the source is taking the entire screen.

<br />

| Parameters ||
|---|---|
| `isFullScreen` | `boolean`: True if the source is full screen, false otherwise. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | If called from an AccessibilityService. |

### setItemCount

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

```
public void setItemCount (int itemCount)
```

Sets the number of items that can be visited.

<br />

| Parameters ||
|---|---|
| `itemCount` | `int`: The number of items. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | If called from an AccessibilityService. |

### setMaxScrollX

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

```
public void setMaxScrollX (int maxScrollX)
```

Sets the max scroll offset of the source left edge in pixels.

<br />

| Parameters ||
|---|---|
| `maxScrollX` | `int`: The max scroll. <br /> |

### setMaxScrollY

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

```
public void setMaxScrollY (int maxScrollY)
```

Sets the max scroll offset of the source top edge in pixels.

<br />

| Parameters ||
|---|---|
| `maxScrollY` | `int`: The max scroll. <br /> |

### setParcelableData

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

```
public void setParcelableData (Parcelable parcelableData)
```

Sets the `https://developer.android.com/reference/android/os/Parcelable` data of the event.

<br />

| Parameters ||
|---|---|
| `parcelableData` | `Parcelable`: The parcelable data. This value may be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | If called from an AccessibilityService. |

### setPassword

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

```
public void setPassword (boolean isPassword)
```

Sets if the source is a password field.

<br />

| Parameters ||
|---|---|
| `isPassword` | `boolean`: True if the view is a password field, false otherwise. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | If called from an AccessibilityService. |

### setRemovedCount

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

```
public void setRemovedCount (int removedCount)
```

Sets the number of removed characters.

<br />

| Parameters ||
|---|---|
| `removedCount` | `int`: The number of removed characters. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | If called from an AccessibilityService. |

### setScrollDeltaX

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

```
public void setScrollDeltaX (int scrollDeltaX)
```

Sets the difference in pixels between the horizontal position before the scroll and the current horizontal position

<br />

| Parameters ||
|---|---|
| `scrollDeltaX` | `int`: the scroll delta x <br /> |

### setScrollDeltaY

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

```
public void setScrollDeltaY (int scrollDeltaY)
```

Sets the difference in pixels between the vertical position before the scroll and the current vertical position

<br />

| Parameters ||
|---|---|
| `scrollDeltaY` | `int`: the scroll delta y <br /> |

### setScrollX

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

```
public void setScrollX (int scrollX)
```

Sets the scroll offset of the source left edge in pixels.

<br />

| Parameters ||
|---|---|
| `scrollX` | `int`: The scroll. <br /> |

### setScrollY

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

```
public void setScrollY (int scrollY)
```

Sets the scroll offset of the source top edge in pixels.

<br />

| Parameters ||
|---|---|
| `scrollY` | `int`: The scroll. <br /> |

### setScrollable

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

```
public void setScrollable (boolean scrollable)
```

Sets if the source is scrollable.

<br />

| Parameters ||
|---|---|
| `scrollable` | `boolean`: True if the source is scrollable, false otherwise. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | If called from an AccessibilityService. |

### setSource

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

```
public void setSource (View root, 
                int virtualDescendantId)
```

Sets the source to be a virtual descendant of the given `root`. If `virtualDescendantId` equals to `https://developer.android.com/reference/android/view/View#NO_ID` the root is set as the source.

A virtual descendant is an imaginary View that is reported as a part of the view hierarchy for accessibility purposes. This enables custom views that draw complex content to report them selves as a tree of virtual views, thus conveying their logical structure.

<br />

<br />

| Parameters ||
|---|---|
| `root` | `View`: The root of the virtual subtree. This value may be `null`. <br /> |
| `virtualDescendantId` | `int`: The id of the virtual descendant. <br /> |

### setSource

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

```
public void setSource (View source)
```

Sets the event source.

<br />

| Parameters ||
|---|---|
| `source` | `View`: The source. This value may be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | If called from an AccessibilityService. |

### setToIndex

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

```
public void setToIndex (int toIndex)
```

Sets the index of text selection end or the index of the last visible item when scrolling.

<br />

| Parameters ||
|---|---|
| `toIndex` | `int`: The index of selection end or last item index. <br /> |

### toString

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

```
public String toString ()
```

Returns a string representation of the object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | a string representation of the object. <br /> |