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

# AccessibilityRequestPreparer

*** ** * ** ***


`
public


abstract
class
AccessibilityRequestPreparer
`


`

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


`

`


`

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

<br />

*** ** * ** ***

Object responsible to ensuring that a `https://developer.android.com/reference/android/view/View` is prepared to meet a synchronous request for
accessibility data.


Because accessibility requests arrive to `https://developer.android.com/reference/android/view/View`s synchronously on the UI thread, a View
that requires information from other processes can struggle to meet those requests. Registering
an instance of this class with `https://developer.android.com/reference/android/view/accessibility/AccessibilityManager` allows a View to be notified when
a request is about to be made, and to asynchronously inform the accessibility system when it is
ready to meet the request.


**Note:** This class should only be needed in exceptional situations where a
`https://developer.android.com/reference/android/view/View` cannot otherwise synchronously meet the request for accessibility data.

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/view/accessibility/AccessibilityRequestPreparer#REQUEST_TYPE_EXTRA_DATA` |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRequestPreparer#AccessibilityRequestPreparer(android.view.View,%20int)(https://developer.android.com/reference/android/view/View view, int requestTypes) ` |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/view/View` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRequestPreparer#getView()() ` Get the view this object was created with. |
| ` abstract void` | ` https://developer.android.com/reference/android/view/accessibility/AccessibilityRequestPreparer#onPrepareExtraData(int,%20java.lang.String,%20android.os.Bundle,%20android.os.Message)(int virtualViewId, https://developer.android.com/reference/java/lang/String extraDataKey, https://developer.android.com/reference/android/os/Bundle args, https://developer.android.com/reference/android/os/Message preparationFinishedMessage) ` Callback to allow preparation for filling extra data. |

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

## Constants

### REQUEST_TYPE_EXTRA_DATA

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

```
public static final int REQUEST_TYPE_EXTRA_DATA
```

<br />

<br />

Constant Value:

1
(0x00000001)


## Public constructors

### AccessibilityRequestPreparer

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

```
public AccessibilityRequestPreparer (View view, 
                int requestTypes)
```

<br />

<br />

| Parameters ||
|---|---|
| `view` | `View`: The view whose requests need preparation. It must be attached to a window. This object will retain a weak reference to this view, and will unregister itself from AccessibilityManager if the view is detached from a window. It will not re-register itself. <br /> |
| `requestTypes` | `int`: The types of requests that require preparation. Different types may be ORed together. Value is either `0` or - `https://developer.android.com/reference/android/view/accessibility/AccessibilityRequestPreparer#REQUEST_TYPE_EXTRA_DATA` |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | if the view is not attached to a window. |

## Public methods

### getView

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

```
public View getView ()
```

Get the view this object was created with.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/View` | The view this object was created with, or `null` if the weak reference held to the view is no longer valid. <br /> |

### onPrepareExtraData

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

```
public abstract void onPrepareExtraData (int virtualViewId, 
                String extraDataKey, 
                Bundle args, 
                Message preparationFinishedMessage)
```

Callback to allow preparation for filling extra data. Only called back if
REQUEST_TYPE_EXTRA_DATA is requested.

<br />

| Parameters ||
|---|---|
| `virtualViewId` | `int`: The ID of a virtual child node, if the `https://developer.android.com/reference/android/view/View` for this preparer supports virtual descendents, or `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeProvider#HOST_VIEW_ID` if the request is for the view itself. <br /> |
| `extraDataKey` | `String`: The extra data key for the request <br /> |
| `args` | `Bundle`: The arguments for the request <br /> |
| `preparationFinishedMessage` | `Message`: A message that must be sent to its target when preparations are complete. <br /> |

**See also:**

- `https://developer.android.com/reference/android/view/View#addExtraDataToAccessibilityNodeInfo(android.view.accessibility.AccessibilityNodeInfo,%20java.lang.String,%20android.os.Bundle)`
- `https://developer.android.com/reference/android/view/View.AccessibilityDelegate#addExtraDataToAccessibilityNodeInfo(android.view.View,%20android.view.accessibility.AccessibilityNodeInfo,%20java.lang.String,%20android.os.Bundle)`
- `https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeProvider#addExtraDataToAccessibilityNodeInfo(int,%20android.view.accessibility.AccessibilityNodeInfo,%20java.lang.String,%20android.os.Bundle)`