Skip to content

Most visited

Recently visited



public abstract class AccessibilityRequestPreparer
extends Object

   ↳ android.view.accessibility.AccessibilityRequestPreparer

Object responsible to ensuring that a View is prepared to meet a synchronous request for accessibility data.

Because accessibility requests arrive to Views 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 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 View cannot otherwise synchronously meet the request for accessibility data.




Public constructors

AccessibilityRequestPreparer(View view, int requestTypes)

Public methods

View getView()

Get the view this object was created with.

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

Callback to allow preparation for filling extra data.

Inherited methods

From class java.lang.Object



added in API level 27

Constant Value: 1 (0x00000001)

Public constructors


added in API level 27
AccessibilityRequestPreparer (View view, 
                int requestTypes)

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.

requestTypes int: The types of requests that require preparation. Different types may be ORed together.

Value is either 0 or REQUEST_TYPE_EXTRA_DATA.

IllegalStateException if the view is not attached to a window.

Public methods


added in API level 27
View getView ()

Get the view this object was created with.

View The view this object was created with, or null if the weak reference held to the view is no longer valid.


added in API level 27
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.

virtualViewId int: The ID of a virtual child node, if the View for this preparer supports virtual descendents, or HOST_VIEW_ID if the request is for the view itself.

extraDataKey String: The extra data key for the request

args Bundle: The arguments for the request

preparationFinishedMessage Message: A message that must be sent to its target when preparations are complete.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields


Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (Dec 2017 Android Platform & Tools Survey)