# ViewStructure

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

# ViewStructure

*** ** * ** ***

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

`
public


abstract
class
ViewStructure
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

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

<br />

*** ** * ** ***

<br />

`ViewStructure`is a container for storing additional per-view data generated by[View.onProvideStructure](https://developer.android.com/reference/android/view/View#onProvideStructure(android.view.ViewStructure))and[View.onProvideAutofillStructure](https://developer.android.com/reference/android/view/View#onProvideAutofillStructure(android.view.ViewStructure,%20int)).

To learn more about using Autofill in your app, read the[Autofill Framework](https://developer.android.com/guide/topics/text/autofill)guides.

## Summary

|                                                                                             ### Nested classes                                                                                              ||
|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` class` | [ViewStructure.HtmlInfo](https://developer.android.com/reference/android/view/ViewStructure.HtmlInfo) Simplified representation of the HTML properties of a node that represents an HTML element. |

|                                                                                                                                                                                                                                 ### Constants                                                                                                                                                                                                                                 ||
|--------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_VIRTUAL_STRUCTURE_TYPE](https://developer.android.com/reference/android/view/ViewStructure#EXTRA_VIRTUAL_STRUCTURE_TYPE) Key used for writing the type of the view that generated the virtual structure of its children.                                                                                                                                                                           |
| [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_VIRTUAL_STRUCTURE_VERSION_NUMBER](https://developer.android.com/reference/android/view/ViewStructure#EXTRA_VIRTUAL_STRUCTURE_VERSION_NUMBER) Key used for specifying the version of the view that generated the virtual structure for itself and its children For example, if the virtual structure is generated by a webview of version "104.0.5112.69", then the value should be "104.0.5112.69" |

|                                            ### Public constructors                                             ||
|-------------------------------------------------------------------------------------------------------------|---|
| ` `[ViewStructure](https://developer.android.com/reference/android/view/ViewStructure#ViewStructure())`() ` |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 ### Public methods                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract int`                                                                                                                                                                                                                                                                                                          | ` `[addChildCount](https://developer.android.com/reference/android/view/ViewStructure#addChildCount(int))`(int num) ` Add to this view's child count.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[asyncCommit](https://developer.android.com/reference/android/view/ViewStructure#asyncCommit())`() ` Call when done populating a[ViewStructure](https://developer.android.com/reference/android/view/ViewStructure)returned by[asyncNewChild(int)](https://developer.android.com/reference/android/view/ViewStructure#asyncNewChild(int)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ` abstract `[ViewStructure](https://developer.android.com/reference/android/view/ViewStructure)                                                                                                                                                                                                                          | ` `[asyncNewChild](https://developer.android.com/reference/android/view/ViewStructure#asyncNewChild(int))`(int index) ` Like[newChild(int)](https://developer.android.com/reference/android/view/ViewStructure#newChild(int)), but allows the caller to asynchronously populate the returned child.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ` void`                                                                                                                                                                                                                                                                                                                  | ` `[clearCredentialManagerRequest](https://developer.android.com/reference/android/view/ViewStructure#clearCredentialManagerRequest())`() ` Clears the credential request previously set through[ViewStructure.setPendingCredentialRequest(GetCredentialRequest, OutcomeReceiver)](https://developer.android.com/reference/android/view/ViewStructure#setPendingCredentialRequest(android.credentials.GetCredentialRequest,%20android.os.OutcomeReceiver<android.credentials.GetCredentialResponse,android.credentials.GetCredentialException>))                                                                                                                                                                                                                                                                                                                                                                          |
| ` abstract `[AutofillId](https://developer.android.com/reference/android/view/autofill/AutofillId)                                                                                                                                                                                                                       | ` `[getAutofillId](https://developer.android.com/reference/android/view/ViewStructure#getAutofillId())`() ` Gets the[AutofillId](https://developer.android.com/reference/android/view/autofill/AutofillId)associated with this node.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ` abstract int`                                                                                                                                                                                                                                                                                                          | ` `[getChildCount](https://developer.android.com/reference/android/view/ViewStructure#getChildCount())`() ` Return the child count as set by[setChildCount(int)](https://developer.android.com/reference/android/view/ViewStructure#setChildCount(int)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ` abstract `[Bundle](https://developer.android.com/reference/android/os/Bundle)                                                                                                                                                                                                                                          | ` `[getExtras](https://developer.android.com/reference/android/view/ViewStructure#getExtras())`() ` Get extra data associated with this view structure; the returned Bundle is mutable, allowing you to view and modify its contents.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ` abstract `[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)                                                                                                                                                                                                                               | ` `[getHint](https://developer.android.com/reference/android/view/ViewStructure#getHint())`() ` Retrieve the last hint set by[setHint(CharSequence)](https://developer.android.com/reference/android/view/ViewStructure#setHint(java.lang.CharSequence)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ` `[OutcomeReceiver](https://developer.android.com/reference/android/os/OutcomeReceiver)`<`[GetCredentialResponse](https://developer.android.com/reference/android/credentials/GetCredentialResponse)`, `[GetCredentialException](https://developer.android.com/reference/android/credentials/GetCredentialException)`>` | ` `[getPendingCredentialCallback](https://developer.android.com/reference/android/view/ViewStructure#getPendingCredentialCallback())`() ` Gets the`callback`associated with this node.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ` `[GetCredentialRequest](https://developer.android.com/reference/android/credentials/GetCredentialRequest)                                                                                                                                                                                                              | ` `[getPendingCredentialRequest](https://developer.android.com/reference/android/view/ViewStructure#getPendingCredentialRequest())`() ` Gets the[GetCredentialRequest](https://developer.android.com/reference/android/credentials/GetCredentialRequest)associated with this node.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ` abstract `[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)                                                                                                                                                                                                                               | ` `[getText](https://developer.android.com/reference/android/view/ViewStructure#getText())`() ` Retrieve the last[setText(java.lang.CharSequence)](https://developer.android.com/reference/android/view/ViewStructure#setText(java.lang.CharSequence)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` abstract int`                                                                                                                                                                                                                                                                                                          | ` `[getTextSelectionEnd](https://developer.android.com/reference/android/view/ViewStructure#getTextSelectionEnd())`() ` Retrieve the last selection end set by[setText(java.lang.CharSequence, int, int)](https://developer.android.com/reference/android/view/ViewStructure#setText(java.lang.CharSequence,%20int,%20int)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ` abstract int`                                                                                                                                                                                                                                                                                                          | ` `[getTextSelectionStart](https://developer.android.com/reference/android/view/ViewStructure#getTextSelectionStart())`() ` Retrieve the last selection start set by[setText(java.lang.CharSequence, int, int)](https://developer.android.com/reference/android/view/ViewStructure#setText(java.lang.CharSequence,%20int,%20int)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ` abstract boolean`                                                                                                                                                                                                                                                                                                      | ` `[hasExtras](https://developer.android.com/reference/android/view/ViewStructure#hasExtras())`() ` Returns true if[getExtras()](https://developer.android.com/reference/android/view/ViewStructure#getExtras())has been used to create extra content.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ` abstract `[ViewStructure](https://developer.android.com/reference/android/view/ViewStructure)                                                                                                                                                                                                                          | ` `[newChild](https://developer.android.com/reference/android/view/ViewStructure#newChild(int))`(int index) ` Create a new child[ViewStructure](https://developer.android.com/reference/android/view/ViewStructure)in this view, putting into the list of children at<var translate="no">index</var>.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ` abstract `[ViewStructure.HtmlInfo.Builder](https://developer.android.com/reference/android/view/ViewStructure.HtmlInfo.Builder)                                                                                                                                                                                        | ` `[newHtmlInfoBuilder](https://developer.android.com/reference/android/view/ViewStructure#newHtmlInfoBuilder(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` tagName) ` Creates a new[HtmlInfo.Builder](https://developer.android.com/reference/android/view/ViewStructure.HtmlInfo.Builder)for the given HTML tag.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setAccessibilityFocused](https://developer.android.com/reference/android/view/ViewStructure#setAccessibilityFocused(boolean))`(boolean state) ` Set the accessibility focused state of this view, as per[View.isAccessibilityFocused()](https://developer.android.com/reference/android/view/View#isAccessibilityFocused()).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setActivated](https://developer.android.com/reference/android/view/ViewStructure#setActivated(boolean))`(boolean state) ` Set the activated state of this view, as per[View.isActivated()](https://developer.android.com/reference/android/view/View#isActivated()).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setAlpha](https://developer.android.com/reference/android/view/ViewStructure#setAlpha(float))`(float alpha) ` Set an alpha transformation that is applied to this view, as per[View.getAlpha()](https://developer.android.com/reference/android/view/View#getAlpha()).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setAutofillHints](https://developer.android.com/reference/android/view/ViewStructure#setAutofillHints(java.lang.String[]))`(`[String[]](https://developer.android.com/reference/java/lang/String)` hint) ` Sets the a hints that helps the autofill service to select the appropriate data to fill the view.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setAutofillId](https://developer.android.com/reference/android/view/ViewStructure#setAutofillId(android.view.autofill.AutofillId))`(`[AutofillId](https://developer.android.com/reference/android/view/autofill/AutofillId)` id) ` Sets the[AutofillId](https://developer.android.com/reference/android/view/autofill/AutofillId)associated with this node.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setAutofillId](https://developer.android.com/reference/android/view/ViewStructure#setAutofillId(android.view.autofill.AutofillId,%20int))`(`[AutofillId](https://developer.android.com/reference/android/view/autofill/AutofillId)` parentId, int virtualId) ` Sets the[AutofillId](https://developer.android.com/reference/android/view/autofill/AutofillId)for this virtual node.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setAutofillOptions](https://developer.android.com/reference/android/view/ViewStructure#setAutofillOptions(java.lang.CharSequence[]))`(`[CharSequence[]](https://developer.android.com/reference/java/lang/CharSequence)` options) ` Sets the options that can be used to autofill this node.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setAutofillType](https://developer.android.com/reference/android/view/ViewStructure#setAutofillType(int))`(int type) ` Sets the[View.getAutofillType()](https://developer.android.com/reference/android/view/View#getAutofillType())that can be used to autofill this node.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setAutofillValue](https://developer.android.com/reference/android/view/ViewStructure#setAutofillValue(android.view.autofill.AutofillValue))`(`[AutofillValue](https://developer.android.com/reference/android/view/autofill/AutofillValue)` value) ` Sets the[AutofillValue](https://developer.android.com/reference/android/view/autofill/AutofillValue)representing the current value of this node.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setCheckable](https://developer.android.com/reference/android/view/ViewStructure#setCheckable(boolean))`(boolean state) ` Set the checkable state of this view, such as whether it implements the[Checkable](https://developer.android.com/reference/android/widget/Checkable)interface.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setChecked](https://developer.android.com/reference/android/view/ViewStructure#setChecked(boolean))`(boolean state) ` Set the checked state of this view, such as[Checkable.isChecked()](https://developer.android.com/reference/android/widget/Checkable#isChecked()).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setChildCount](https://developer.android.com/reference/android/view/ViewStructure#setChildCount(int))`(int num) ` Set the number of children of this view, which defines the range of indices you can use with[newChild(int)](https://developer.android.com/reference/android/view/ViewStructure#newChild(int))and[asyncNewChild(int)](https://developer.android.com/reference/android/view/ViewStructure#asyncNewChild(int)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setClassName](https://developer.android.com/reference/android/view/ViewStructure#setClassName(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` className) ` Set the class name of the view, as per[View.getAccessibilityClassName()](https://developer.android.com/reference/android/view/View#getAccessibilityClassName()).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setClickable](https://developer.android.com/reference/android/view/ViewStructure#setClickable(boolean))`(boolean state) ` Set the clickable state of this view, as per[View.isClickable()](https://developer.android.com/reference/android/view/View#isClickable()).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setContentDescription](https://developer.android.com/reference/android/view/ViewStructure#setContentDescription(java.lang.CharSequence))`(`[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)` contentDescription) ` Set the content description of the view, as per[View.getContentDescription()](https://developer.android.com/reference/android/view/View#getContentDescription()).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setContextClickable](https://developer.android.com/reference/android/view/ViewStructure#setContextClickable(boolean))`(boolean state) ` Set the context clickable state of this view, as per[View.isContextClickable()](https://developer.android.com/reference/android/view/View#isContextClickable()).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setDataIsSensitive](https://developer.android.com/reference/android/view/ViewStructure#setDataIsSensitive(boolean))`(boolean sensitive) ` Sets whether the data on this node is sensitive; if it is, then its content (text, autofill value, etc..) is striped before calls to[AutofillService.onFillRequest(android.service.autofill.FillRequest, android.os.CancellationSignal, android.service.autofill.FillCallback)](https://developer.android.com/reference/android/service/autofill/AutofillService#onFillRequest(android.service.autofill.FillRequest,%20android.os.CancellationSignal,%20android.service.autofill.FillCallback)).                                                                                                                                                                                                                                                                            |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setDimens](https://developer.android.com/reference/android/view/ViewStructure#setDimens(int,%20int,%20int,%20int,%20int,%20int))`(int left, int top, int scrollX, int scrollY, int width, int height) ` Set the basic dimensions of this view.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setElevation](https://developer.android.com/reference/android/view/ViewStructure#setElevation(float))`(float elevation) ` Set the visual elevation (shadow) of the view, as per[View.getZ()](https://developer.android.com/reference/android/view/View#getZ()).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setEnabled](https://developer.android.com/reference/android/view/ViewStructure#setEnabled(boolean))`(boolean state) ` Set the enabled state of this view, as per[View.isEnabled()](https://developer.android.com/reference/android/view/View#isEnabled()).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setFocusable](https://developer.android.com/reference/android/view/ViewStructure#setFocusable(boolean))`(boolean state) ` Set the focusable state of this view, as per[View.isFocusable()](https://developer.android.com/reference/android/view/View#isFocusable()).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setFocused](https://developer.android.com/reference/android/view/ViewStructure#setFocused(boolean))`(boolean state) ` Set the focused state of this view, as per[View.isFocused()](https://developer.android.com/reference/android/view/View#isFocused()).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setHint](https://developer.android.com/reference/android/view/ViewStructure#setHint(java.lang.CharSequence))`(`[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)` hint) ` Set optional hint text associated with this view; this is for example the text that is shown by an EditText when it is empty to indicate to the user the kind of text to input.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ` void`                                                                                                                                                                                                                                                                                                                  | ` `[setHintIdEntry](https://developer.android.com/reference/android/view/ViewStructure#setHintIdEntry(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` entryName) ` Sets the identifier used to set the hint associated with this view.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setHtmlInfo](https://developer.android.com/reference/android/view/ViewStructure#setHtmlInfo(android.view.ViewStructure.HtmlInfo))`(`[ViewStructure.HtmlInfo](https://developer.android.com/reference/android/view/ViewStructure.HtmlInfo)` htmlInfo) ` Sets the HTML properties of this node when it represents an HTML element.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setId](https://developer.android.com/reference/android/view/ViewStructure#setId(int,%20java.lang.String,%20java.lang.String,%20java.lang.String))`(int id, `[String](https://developer.android.com/reference/java/lang/String)` packageName, `[String](https://developer.android.com/reference/java/lang/String)` typeName, `[String](https://developer.android.com/reference/java/lang/String)` entryName) ` Set the identifier for this view.                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ` void`                                                                                                                                                                                                                                                                                                                  | ` `[setImportantForAutofill](https://developer.android.com/reference/android/view/ViewStructure#setImportantForAutofill(int))`(int mode) ` Sets the[importantForAutofill mode](https://developer.android.com/reference/android/view/View#setImportantForAutofill(int))of the view associated with this node.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setInputType](https://developer.android.com/reference/android/view/ViewStructure#setInputType(int))`(int inputType) ` Sets the[InputType](https://developer.android.com/reference/android/text/InputType)bits of this node.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setLocaleList](https://developer.android.com/reference/android/view/ViewStructure#setLocaleList(android.os.LocaleList))`(`[LocaleList](https://developer.android.com/reference/android/os/LocaleList)` localeList) ` Sets the the list of locales associated with this node.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setLongClickable](https://developer.android.com/reference/android/view/ViewStructure#setLongClickable(boolean))`(boolean state) ` Set the long clickable state of this view, as per[View.isLongClickable()](https://developer.android.com/reference/android/view/View#isLongClickable()).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ` void`                                                                                                                                                                                                                                                                                                                  | ` `[setMaxTextEms](https://developer.android.com/reference/android/view/ViewStructure#setMaxTextEms(int))`(int maxEms) ` Sets the maximum width in ems of the text associated with this view, when supported.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ` void`                                                                                                                                                                                                                                                                                                                  | ` `[setMaxTextLength](https://developer.android.com/reference/android/view/ViewStructure#setMaxTextLength(int))`(int maxLength) ` Sets the maximum length of the text associated with this view, when supported.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ` void`                                                                                                                                                                                                                                                                                                                  | ` `[setMinTextEms](https://developer.android.com/reference/android/view/ViewStructure#setMinTextEms(int))`(int minEms) ` Sets the minimum width in ems of the text associated with this view, when supported.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setOpaque](https://developer.android.com/reference/android/view/ViewStructure#setOpaque(boolean))`(boolean opaque) ` Set the opaque state of this view, as per[View.isOpaque()](https://developer.android.com/reference/android/view/View#isOpaque()).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ` void`                                                                                                                                                                                                                                                                                                                  | ` `[setPendingCredentialRequest](https://developer.android.com/reference/android/view/ViewStructure#setPendingCredentialRequest(android.credentials.GetCredentialRequest,%20android.os.OutcomeReceiver<android.credentials.GetCredentialResponse,android.credentials.GetCredentialException>))`(`[GetCredentialRequest](https://developer.android.com/reference/android/credentials/GetCredentialRequest)` request, `[OutcomeReceiver](https://developer.android.com/reference/android/os/OutcomeReceiver)`<`[GetCredentialResponse](https://developer.android.com/reference/android/credentials/GetCredentialResponse)`, `[GetCredentialException](https://developer.android.com/reference/android/credentials/GetCredentialException)`> callback) ` Sets a credential request to be fired to[CredentialManager](https://developer.android.com/reference/android/credentials/CredentialManager)when this node is focused |
| ` void`                                                                                                                                                                                                                                                                                                                  | ` `[setReceiveContentMimeTypes](https://developer.android.com/reference/android/view/ViewStructure#setReceiveContentMimeTypes(java.lang.String[]))`(`[String[]](https://developer.android.com/reference/java/lang/String)` mimeTypes) ` Sets the MIME types accepted by this view.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setSelected](https://developer.android.com/reference/android/view/ViewStructure#setSelected(boolean))`(boolean state) ` Set the selected state of this view, as per[View.isSelected()](https://developer.android.com/reference/android/view/View#isSelected()).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setText](https://developer.android.com/reference/android/view/ViewStructure#setText(java.lang.CharSequence))`(`[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)` text) ` Set the text that is associated with this view.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setText](https://developer.android.com/reference/android/view/ViewStructure#setText(java.lang.CharSequence,%20int,%20int))`(`[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)` text, int selectionStart, int selectionEnd) ` Like[setText(java.lang.CharSequence)](https://developer.android.com/reference/android/view/ViewStructure#setText(java.lang.CharSequence))but with an active selection extending from<var translate="no">selectionStart</var>through<var translate="no">selectionEnd</var>.                                                                                                                                                                                                                                                                                                                                                                                 |
| ` void`                                                                                                                                                                                                                                                                                                                  | ` `[setTextIdEntry](https://developer.android.com/reference/android/view/ViewStructure#setTextIdEntry(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` entryName) ` Sets the identifier used to set the text associated with this view.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setTextLines](https://developer.android.com/reference/android/view/ViewStructure#setTextLines(int[],%20int[]))`(int[] charOffsets, int[] baselines) ` Set line information for test that was previously supplied through[setText(java.lang.CharSequence)](https://developer.android.com/reference/android/view/ViewStructure#setText(java.lang.CharSequence)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setTextStyle](https://developer.android.com/reference/android/view/ViewStructure#setTextStyle(float,%20int,%20int,%20int))`(float size, int fgColor, int bgColor, int style) ` Explicitly set default global style information for text that was previously set with[setText(CharSequence)](https://developer.android.com/reference/android/view/ViewStructure#setText(java.lang.CharSequence)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setTransformation](https://developer.android.com/reference/android/view/ViewStructure#setTransformation(android.graphics.Matrix))`(`[Matrix](https://developer.android.com/reference/android/graphics/Matrix)` matrix) ` Set the transformation matrix associated with this view, as per[View.getMatrix()](https://developer.android.com/reference/android/view/View#getMatrix()), or null if there is none.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setVisibility](https://developer.android.com/reference/android/view/ViewStructure#setVisibility(int))`(int visibility) ` Set the visibility state of this view, as per[View.getVisibility()](https://developer.android.com/reference/android/view/View#getVisibility()).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ` abstract void`                                                                                                                                                                                                                                                                                                         | ` `[setWebDomain](https://developer.android.com/reference/android/view/ViewStructure#setWebDomain(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` domain) ` Sets the Web domain represented by this node.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](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 `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](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`                                                                  | ` `[wait](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`                                                                  | ` `[wait](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

### EXTRA_VIRTUAL_STRUCTURE_TYPE

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

```
public static final String EXTRA_VIRTUAL_STRUCTURE_TYPE
```

Key used for writing the type of the view that generated the virtual structure of its children.

For example, if the virtual structure is generated by a webview, the value would be "WebView". If the virtual structure is generated by a compose view, then the value would be "ComposeView". The value is of type String.

This value is added to mainly help with debugging purpose.

<br />

Constant Value: "android.view.extra.VIRTUAL_STRUCTURE_TYPE"  

### EXTRA_VIRTUAL_STRUCTURE_VERSION_NUMBER

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

```
public static final String EXTRA_VIRTUAL_STRUCTURE_VERSION_NUMBER
```

Key used for specifying the version of the view that generated the virtual structure for itself and its children

For example, if the virtual structure is generated by a webview of version "104.0.5112.69", then the value should be "104.0.5112.69"

<br />

Constant Value: "android.view.extra.VIRTUAL_STRUCTURE_VERSION_NUMBER"

## Public constructors

### ViewStructure

```
public ViewStructure ()
```

<br />

<br />

## Public methods

### addChildCount

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

```
public abstract int addChildCount (int num)
```

Add to this view's child count. This increases the current child count by<var translate="no">num</var>children beyond what was last set by[setChildCount(int)](https://developer.android.com/reference/android/view/ViewStructure#setChildCount(int))or[addChildCount(int)](https://developer.android.com/reference/android/view/ViewStructure#addChildCount(int)). The index at which the new child starts in the child array is returned.

<br />

|                       Parameters                        ||
|-------|--------------------------------------------------|
| `num` | `int`: The number of new children to add. <br /> |

|                                       Returns                                       ||
|-------|------------------------------------------------------------------------------|
| `int` | Returns the index in the child array at which the new children start. <br /> |

### asyncCommit

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

```
public abstract void asyncCommit ()
```

Call when done populating a[ViewStructure](https://developer.android.com/reference/android/view/ViewStructure)returned by[asyncNewChild(int)](https://developer.android.com/reference/android/view/ViewStructure#asyncNewChild(int)).

<br />

### asyncNewChild

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

```
public abstract ViewStructure asyncNewChild (int index)
```

Like[newChild(int)](https://developer.android.com/reference/android/view/ViewStructure#newChild(int)), but allows the caller to asynchronously populate the returned child. It can transfer the returned[ViewStructure](https://developer.android.com/reference/android/view/ViewStructure)to another thread for it to build its content (and children etc). Once done, some thread must call[asyncCommit()](https://developer.android.com/reference/android/view/ViewStructure#asyncCommit())to tell the containing[ViewStructure](https://developer.android.com/reference/android/view/ViewStructure)that the async population is done.

**NOTE:** you must pre-allocate space for the child first, by calling either[addChildCount(int)](https://developer.android.com/reference/android/view/ViewStructure#addChildCount(int))or[setChildCount(int)](https://developer.android.com/reference/android/view/ViewStructure#setChildCount(int)).

<br />

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

|                                                                                                        Returns                                                                                                        ||
|-------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------|
| [ViewStructure](https://developer.android.com/reference/android/view/ViewStructure) | Returns an fresh[ViewStructure](https://developer.android.com/reference/android/view/ViewStructure)ready to be filled in. <br /> |

### clearCredentialManagerRequest

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

```
public void clearCredentialManagerRequest ()
```

Clears the credential request previously set through[ViewStructure.setPendingCredentialRequest(GetCredentialRequest, OutcomeReceiver)](https://developer.android.com/reference/android/view/ViewStructure#setPendingCredentialRequest(android.credentials.GetCredentialRequest,%20android.os.OutcomeReceiver<android.credentials.GetCredentialResponse,android.credentials.GetCredentialException>))

<br />

### getAutofillId

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

```
public abstract AutofillId getAutofillId ()
```

Gets the[AutofillId](https://developer.android.com/reference/android/view/autofill/AutofillId)associated with this node.

<br />

|                                                         Returns                                                         ||
|----------------------------------------------------------------------------------------|---------------------------------|
| [AutofillId](https://developer.android.com/reference/android/view/autofill/AutofillId) | This value may be`null`. <br /> |

### getChildCount

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

```
public abstract int getChildCount ()
```

Return the child count as set by[setChildCount(int)](https://developer.android.com/reference/android/view/ViewStructure#setChildCount(int)).

<br />

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

### getExtras

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

```
public abstract Bundle getExtras ()
```

Get extra data associated with this view structure; the returned Bundle is mutable, allowing you to view and modify its contents. Keys placed in the Bundle should use an appropriate namespace prefix (such as com.google.MY_KEY) to avoid conflicts.

<br />

|                                   Returns                                   ||
|---------------------------------------------------------------------|--------|
| [Bundle](https://developer.android.com/reference/android/os/Bundle) | <br /> |

### getHint

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

```
public abstract CharSequence getHint ()
```

Retrieve the last hint set by[setHint(CharSequence)](https://developer.android.com/reference/android/view/ViewStructure#setHint(java.lang.CharSequence)).

<br />

|                                        Returns                                         ||
|--------------------------------------------------------------------------------|--------|
| [CharSequence](https://developer.android.com/reference/java/lang/CharSequence) | <br /> |

### getPendingCredentialCallback

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

```
public OutcomeReceiver<GetCredentialResponse, GetCredentialException> getPendingCredentialCallback ()
```

Gets the`callback`associated with this node.

If null, no callback or request is associated with this node, and hence no[CredentialManager](https://developer.android.com/reference/android/credentials/CredentialManager)request will be fired when this node is focused.

For details on how a request and callback can be set, see[ViewStructure.setPendingCredentialRequest(GetCredentialRequest, OutcomeReceiver)](https://developer.android.com/reference/android/view/ViewStructure#setPendingCredentialRequest(android.credentials.GetCredentialRequest,%20android.os.OutcomeReceiver<android.credentials.GetCredentialResponse,android.credentials.GetCredentialException>))

<br />

|                                                                                                                                                            Returns                                                                                                                                                            ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|
| [OutcomeReceiver](https://developer.android.com/reference/android/os/OutcomeReceiver)`<`[GetCredentialResponse](https://developer.android.com/reference/android/credentials/GetCredentialResponse)`, `[GetCredentialException](https://developer.android.com/reference/android/credentials/GetCredentialException)`>` | <br /> |

### getPendingCredentialRequest

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

```
public GetCredentialRequest getPendingCredentialRequest ()
```

Gets the[GetCredentialRequest](https://developer.android.com/reference/android/credentials/GetCredentialRequest)associated with this node.

If null, no request is associated with this node, and hence no[CredentialManager](https://developer.android.com/reference/android/credentials/CredentialManager)request will be fired when this node is focused.

For details on how a request and callback can be set, see[ViewStructure.setPendingCredentialRequest(GetCredentialRequest, OutcomeReceiver)](https://developer.android.com/reference/android/view/ViewStructure#setPendingCredentialRequest(android.credentials.GetCredentialRequest,%20android.os.OutcomeReceiver<android.credentials.GetCredentialResponse,android.credentials.GetCredentialException>))

<br />

|                                                     Returns                                                      ||
|----------------------------------------------------------------------------------------------------------|--------|
| [GetCredentialRequest](https://developer.android.com/reference/android/credentials/GetCredentialRequest) | <br /> |

### getText

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

```
public abstract CharSequence getText ()
```

Retrieve the last[setText(java.lang.CharSequence)](https://developer.android.com/reference/android/view/ViewStructure#setText(java.lang.CharSequence)).

<br />

|                                        Returns                                         ||
|--------------------------------------------------------------------------------|--------|
| [CharSequence](https://developer.android.com/reference/java/lang/CharSequence) | <br /> |

### getTextSelectionEnd

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

```
public abstract int getTextSelectionEnd ()
```

Retrieve the last selection end set by[setText(java.lang.CharSequence, int, int)](https://developer.android.com/reference/android/view/ViewStructure#setText(java.lang.CharSequence,%20int,%20int)).

<br />

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

### getTextSelectionStart

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

```
public abstract int getTextSelectionStart ()
```

Retrieve the last selection start set by[setText(java.lang.CharSequence, int, int)](https://developer.android.com/reference/android/view/ViewStructure#setText(java.lang.CharSequence,%20int,%20int)).

<br />

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

### hasExtras

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

```
public abstract boolean hasExtras ()
```

Returns true if[getExtras()](https://developer.android.com/reference/android/view/ViewStructure#getExtras())has been used to create extra content.

<br />

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

### newChild

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

```
public abstract ViewStructure newChild (int index)
```

Create a new child[ViewStructure](https://developer.android.com/reference/android/view/ViewStructure)in this view, putting into the list of children at<var translate="no">index</var>.

**NOTE:** you must pre-allocate space for the child first, by calling either[addChildCount(int)](https://developer.android.com/reference/android/view/ViewStructure#addChildCount(int))or[setChildCount(int)](https://developer.android.com/reference/android/view/ViewStructure#setChildCount(int)).

<br />

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

|                                                                                                        Returns                                                                                                        ||
|-------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------|
| [ViewStructure](https://developer.android.com/reference/android/view/ViewStructure) | Returns an fresh[ViewStructure](https://developer.android.com/reference/android/view/ViewStructure)ready to be filled in. <br /> |

### newHtmlInfoBuilder

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

```
public abstract ViewStructure.HtmlInfo.Builder newHtmlInfoBuilder (String tagName)
```

Creates a new[HtmlInfo.Builder](https://developer.android.com/reference/android/view/ViewStructure.HtmlInfo.Builder)for the given HTML tag.

<br />

|                                  Parameters                                   ||
|-----------|--------------------------------------------------------------------|
| `tagName` | `String`: name of the HTML tag. This value cannot be`null`. <br /> |

|                                                                   Returns                                                                    ||
|-----------------------------------------------------------------------------------------------------------------------|-----------------------|
| [ViewStructure.HtmlInfo.Builder](https://developer.android.com/reference/android/view/ViewStructure.HtmlInfo.Builder) | a new builder. <br /> |

### setAccessibilityFocused

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

```
public abstract void setAccessibilityFocused (boolean state)
```

Set the accessibility focused state of this view, as per[View.isAccessibilityFocused()](https://developer.android.com/reference/android/view/View#isAccessibilityFocused()).

<br />

|        Parameters         ||
|---------|------------------|
| `state` | `boolean` <br /> |

### setActivated

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

```
public abstract void setActivated (boolean state)
```

Set the activated state of this view, as per[View.isActivated()](https://developer.android.com/reference/android/view/View#isActivated()).

<br />

|        Parameters         ||
|---------|------------------|
| `state` | `boolean` <br /> |

### setAlpha

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

```
public abstract void setAlpha (float alpha)
```

Set an alpha transformation that is applied to this view, as per[View.getAlpha()](https://developer.android.com/reference/android/view/View#getAlpha()). Value ranges from 0 (completely transparent) to 1 (completely opaque); the default is 1, which means no transformation.

<br />

|       Parameters        ||
|---------|----------------|
| `alpha` | `float` <br /> |

### setAutofillHints

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

```
public abstract void setAutofillHints (String[] hint)
```

Sets the a hints that helps the autofill service to select the appropriate data to fill the view.

<br />

|                    Parameters                     ||
|--------|-------------------------------------------|
| `hint` | `String`: This value may be`null`. <br /> |

### setAutofillId

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

```
public abstract void setAutofillId (AutofillId id)
```

Sets the[AutofillId](https://developer.android.com/reference/android/view/autofill/AutofillId)associated with this node.

<br />

|                       Parameters                       ||
|------|--------------------------------------------------|
| `id` | `AutofillId`: This value cannot be`null`. <br /> |

### setAutofillId

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

```
public abstract void setAutofillId (AutofillId parentId, 
                int virtualId)
```

Sets the[AutofillId](https://developer.android.com/reference/android/view/autofill/AutofillId)for this virtual node.

<br />

|                                                                                                                              Parameters                                                                                                                              ||
|-------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `parentId`  | `AutofillId`: id of the parent node. This value cannot be`null`. <br />                                                                                                                                                                                 |
| `virtualId` | `int`: an opaque ID to the Android System; it's the same id used on[View.autofill(android.util.SparseArray)](https://developer.android.com/reference/android/view/View#autofill(android.util.SparseArray<android.view.autofill.AutofillValue>)). <br /> |

### setAutofillOptions

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

```
public abstract void setAutofillOptions (CharSequence[] options)
```

Sets the options that can be used to autofill this node.

Typically used by nodes whose[View.getAutofillType()](https://developer.android.com/reference/android/view/View#getAutofillType())is a list to indicate the meaning of each possible value in the list.

<br />

|            Parameters            ||
|-----------|-----------------------|
| `options` | `CharSequence` <br /> |

### setAutofillType

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

```
public abstract void setAutofillType (int type)
```

Sets the[View.getAutofillType()](https://developer.android.com/reference/android/view/View#getAutofillType())that can be used to autofill this node.

<br />

|                                                                                                                                                                                                                                                                                  Parameters                                                                                                                                                                                                                                                                                  ||
|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `type` | `int`: Value is[View.AUTOFILL_TYPE_NONE](https://developer.android.com/reference/android/view/View#AUTOFILL_TYPE_NONE),[View.AUTOFILL_TYPE_TEXT](https://developer.android.com/reference/android/view/View#AUTOFILL_TYPE_TEXT),[View.AUTOFILL_TYPE_TOGGLE](https://developer.android.com/reference/android/view/View#AUTOFILL_TYPE_TOGGLE),[View.AUTOFILL_TYPE_LIST](https://developer.android.com/reference/android/view/View#AUTOFILL_TYPE_LIST), or[View.AUTOFILL_TYPE_DATE](https://developer.android.com/reference/android/view/View#AUTOFILL_TYPE_DATE) <br /> |

### setAutofillValue

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

```
public abstract void setAutofillValue (AutofillValue value)
```

Sets the[AutofillValue](https://developer.android.com/reference/android/view/autofill/AutofillValue)representing the current value of this node.

<br />

|           Parameters            ||
|---------|------------------------|
| `value` | `AutofillValue` <br /> |

### setCheckable

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

```
public abstract void setCheckable (boolean state)
```

Set the checkable state of this view, such as whether it implements the[Checkable](https://developer.android.com/reference/android/widget/Checkable)interface.

<br />

|        Parameters         ||
|---------|------------------|
| `state` | `boolean` <br /> |

### setChecked

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

```
public abstract void setChecked (boolean state)
```

Set the checked state of this view, such as[Checkable.isChecked()](https://developer.android.com/reference/android/widget/Checkable#isChecked()).

<br />

|        Parameters         ||
|---------|------------------|
| `state` | `boolean` <br /> |

### setChildCount

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

```
public abstract void setChildCount (int num)
```

Set the number of children of this view, which defines the range of indices you can use with[newChild(int)](https://developer.android.com/reference/android/view/ViewStructure#newChild(int))and[asyncNewChild(int)](https://developer.android.com/reference/android/view/ViewStructure#asyncNewChild(int)). Calling this method again resets all of the child state of the view, removing any children that had previously been added.

<br />

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

### setClassName

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

```
public abstract void setClassName (String className)
```

Set the class name of the view, as per[View.getAccessibilityClassName()](https://developer.android.com/reference/android/view/View#getAccessibilityClassName()).

<br />

|          Parameters          ||
|-------------|-----------------|
| `className` | `String` <br /> |

### setClickable

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

```
public abstract void setClickable (boolean state)
```

Set the clickable state of this view, as per[View.isClickable()](https://developer.android.com/reference/android/view/View#isClickable()).

<br />

|        Parameters         ||
|---------|------------------|
| `state` | `boolean` <br /> |

### setContentDescription

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

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

Set the content description of the view, as per[View.getContentDescription()](https://developer.android.com/reference/android/view/View#getContentDescription()).

<br />

|                 Parameters                  ||
|----------------------|-----------------------|
| `contentDescription` | `CharSequence` <br /> |

### setContextClickable

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

```
public abstract void setContextClickable (boolean state)
```

Set the context clickable state of this view, as per[View.isContextClickable()](https://developer.android.com/reference/android/view/View#isContextClickable()).

<br />

|        Parameters         ||
|---------|------------------|
| `state` | `boolean` <br /> |

### setDataIsSensitive

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

```
public abstract void setDataIsSensitive (boolean sensitive)
```

Sets whether the data on this node is sensitive; if it is, then its content (text, autofill value, etc..) is striped before calls to[AutofillService.onFillRequest(android.service.autofill.FillRequest, android.os.CancellationSignal, android.service.autofill.FillCallback)](https://developer.android.com/reference/android/service/autofill/AutofillService#onFillRequest(android.service.autofill.FillRequest,%20android.os.CancellationSignal,%20android.service.autofill.FillCallback)).

By default, all nodes are assumed to be sensitive, and only nodes that does not have PII (Personally Identifiable Information - sensitive data such as email addresses, credit card numbers, passwords, etc...) should be marked as non-sensitive; a good rule of thumb is to mark as non-sensitive nodes whose value were statically set from resources.

Notice that the content of even sensitive nodes are sent to the service (through the[AutofillService.onSaveRequest(android.service.autofill.SaveRequest, android.service.autofill.SaveCallback)](https://developer.android.com/reference/android/service/autofill/AutofillService#onSaveRequest(android.service.autofill.SaveRequest,%20android.service.autofill.SaveCallback))call) when the user consented to save thedata, so it is important to set the content of sensitive nodes as well, but mark them as sensitive.

Should only be set when the node is used for autofill purposes - it will be ignored when used for Assist.

<br />

|          Parameters           ||
|-------------|------------------|
| `sensitive` | `boolean` <br /> |

### setDimens

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

```
public abstract void setDimens (int left, 
                int top, 
                int scrollX, 
                int scrollY, 
                int width, 
                int height)
```

Set the basic dimensions of this view.

<br />

|                                                                      Parameters                                                                      ||
|-----------|-------------------------------------------------------------------------------------------------------------------------------------------|
| `left`    | `int`: The view's left position, in pixels relative to its parent's left edge. <br />                                                     |
| `top`     | `int`: The view's top position, in pixels relative to its parent's top edge. <br />                                                       |
| `scrollX` | `int`: How much the view's x coordinate space has been scrolled, in pixels. <br />                                                        |
| `scrollY` | `int`: How much the view's y coordinate space has been scrolled, in pixels. <br />                                                        |
| `width`   | `int`: The view's visible width, in pixels. This is the width visible on screen, not the total data width of a scrollable view. <br />    |
| `height`  | `int`: The view's visible height, in pixels. This is the height visible on screen, not the total data height of a scrollable view. <br /> |

### setElevation

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

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

Set the visual elevation (shadow) of the view, as per[View.getZ()](https://developer.android.com/reference/android/view/View#getZ()). Note this is*not*related to the physical Z-ordering of this view relative to its other siblings (that is how they overlap when drawing), it is only the visual representation for shadowing.

<br />

|         Parameters          ||
|-------------|----------------|
| `elevation` | `float` <br /> |

### setEnabled

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

```
public abstract void setEnabled (boolean state)
```

Set the enabled state of this view, as per[View.isEnabled()](https://developer.android.com/reference/android/view/View#isEnabled()).

<br />

|        Parameters         ||
|---------|------------------|
| `state` | `boolean` <br /> |

### setFocusable

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

```
public abstract void setFocusable (boolean state)
```

Set the focusable state of this view, as per[View.isFocusable()](https://developer.android.com/reference/android/view/View#isFocusable()).

<br />

|        Parameters         ||
|---------|------------------|
| `state` | `boolean` <br /> |

### setFocused

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

```
public abstract void setFocused (boolean state)
```

Set the focused state of this view, as per[View.isFocused()](https://developer.android.com/reference/android/view/View#isFocused()).

<br />

|        Parameters         ||
|---------|------------------|
| `state` | `boolean` <br /> |

### setHint

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

```
public abstract void setHint (CharSequence hint)
```

Set optional hint text associated with this view; this is for example the text that is shown by an EditText when it is empty to indicate to the user the kind of text to input.

<br />

|          Parameters           ||
|--------|-----------------------|
| `hint` | `CharSequence` <br /> |

### setHintIdEntry

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

```
public void setHintIdEntry (String entryName)
```

Sets the identifier used to set the hint associated with this view.

Used as metadata for fingerprinting view nodes/structures.

Should only be set when the node is used for autofill purposes - it will be ignored when used for Assist.

<br />

|                        Parameters                         ||
|-------------|----------------------------------------------|
| `entryName` | `String`: This value cannot be`null`. <br /> |

### setHtmlInfo

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

```
public abstract void setHtmlInfo (ViewStructure.HtmlInfo htmlInfo)
```

Sets the HTML properties of this node when it represents an HTML element.

Should only be set when the node is used for autofill purposes - it will be ignored when used for assist.

<br />

|                                        Parameters                                         ||
|------------|-------------------------------------------------------------------------------|
| `htmlInfo` | `ViewStructure.HtmlInfo`: HTML properties. This value cannot be`null`. <br /> |

### setId

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

```
public abstract void setId (int id, 
                String packageName, 
                String typeName, 
                String entryName)
```

Set the identifier for this view.

<br />

|                                                                  Parameters                                                                  ||
|---------------|-------------------------------------------------------------------------------------------------------------------------------|
| `id`          | `int`: The view's identifier, as per[View.getId()](https://developer.android.com/reference/android/view/View#getId()). <br /> |
| `packageName` | `String`: The package name of the view's identifier, or null if there is none. <br />                                         |
| `typeName`    | `String`: The type name of the view's identifier, or null if there is none. <br />                                            |
| `entryName`   | `String`: The entry name of the view's identifier, or null if there is none. <br />                                           |

### setImportantForAutofill

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

```
public void setImportantForAutofill (int mode)
```

Sets the[importantForAutofill mode](https://developer.android.com/reference/android/view/View#setImportantForAutofill(int))of the view associated with this node.

<br />

|                                                                                                                                                                                                                                                                                                                                                               Parameters                                                                                                                                                                                                                                                                                                                                                               ||
|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `mode` | `int`: Value is[View.IMPORTANT_FOR_AUTOFILL_AUTO](https://developer.android.com/reference/android/view/View#IMPORTANT_FOR_AUTOFILL_AUTO),[View.IMPORTANT_FOR_AUTOFILL_YES](https://developer.android.com/reference/android/view/View#IMPORTANT_FOR_AUTOFILL_YES),[View.IMPORTANT_FOR_AUTOFILL_NO](https://developer.android.com/reference/android/view/View#IMPORTANT_FOR_AUTOFILL_NO),[View.IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS](https://developer.android.com/reference/android/view/View#IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS), or[View.IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS](https://developer.android.com/reference/android/view/View#IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS) <br /> |

### setInputType

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

```
public abstract void setInputType (int inputType)
```

Sets the[InputType](https://developer.android.com/reference/android/text/InputType)bits of this node.

<br />

|                                                             Parameters                                                              ||
|-------------|------------------------------------------------------------------------------------------------------------------------|
| `inputType` | `int`: inputType bits as defined by[InputType](https://developer.android.com/reference/android/text/InputType). <br /> |

### setLocaleList

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

```
public abstract void setLocaleList (LocaleList localeList)
```

Sets the the list of locales associated with this node.

<br />

|            Parameters             ||
|--------------|---------------------|
| `localeList` | `LocaleList` <br /> |

### setLongClickable

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

```
public abstract void setLongClickable (boolean state)
```

Set the long clickable state of this view, as per[View.isLongClickable()](https://developer.android.com/reference/android/view/View#isLongClickable()).

<br />

|        Parameters         ||
|---------|------------------|
| `state` | `boolean` <br /> |

### setMaxTextEms

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

```
public void setMaxTextEms (int maxEms)
```

Sets the maximum width in ems of the text associated with this view, when supported.

Should only be set when the node is used for autofill purposes - it will be ignored when used for Assist.

<br />

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

### setMaxTextLength

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

```
public void setMaxTextLength (int maxLength)
```

Sets the maximum length of the text associated with this view, when supported.

Should only be set when the node is used for autofill purposes - it will be ignored when used for Assist.

<br />

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

### setMinTextEms

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

```
public void setMinTextEms (int minEms)
```

Sets the minimum width in ems of the text associated with this view, when supported.

Should only be set when the node is used for autofill purposes - it will be ignored when used for Assist.

<br />

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

### setOpaque

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

```
public abstract void setOpaque (boolean opaque)
```

Set the opaque state of this view, as per[View.isOpaque()](https://developer.android.com/reference/android/view/View#isOpaque()).

<br />

|         Parameters         ||
|----------|------------------|
| `opaque` | `boolean` <br /> |

### setPendingCredentialRequest

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

```
public void setPendingCredentialRequest (GetCredentialRequest request, 
                OutcomeReceiver<GetCredentialResponse, GetCredentialException> callback)
```

Sets a credential request to be fired to[CredentialManager](https://developer.android.com/reference/android/credentials/CredentialManager)when this node is focused

<br />

|                                                         Parameters                                                          ||
|------------|-----------------------------------------------------------------------------------------------------------------|
| `request`  | `GetCredentialRequest`: the request to be fired This value cannot be`null`. <br />                              |
| `callback` | `OutcomeReceiver`: the callback where the response or exception, is returned This value cannot be`null`. <br /> |

### setReceiveContentMimeTypes

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

```
public void setReceiveContentMimeTypes (String[] mimeTypes)
```

Sets the MIME types accepted by this view. See[View.getReceiveContentMimeTypes()](https://developer.android.com/reference/android/view/View#getReceiveContentMimeTypes()).

Should only be set when the node is used for Autofill or Content Capture purposes - it will be ignored when used for Assist.

<br />

|                       Parameters                       ||
|-------------|-------------------------------------------|
| `mimeTypes` | `String`: This value may be`null`. <br /> |

### setSelected

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

```
public abstract void setSelected (boolean state)
```

Set the selected state of this view, as per[View.isSelected()](https://developer.android.com/reference/android/view/View#isSelected()).

<br />

|        Parameters         ||
|---------|------------------|
| `state` | `boolean` <br /> |

### setText

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

```
public abstract void setText (CharSequence text)
```

Set the text that is associated with this view. There is no selection associated with the text. The text may have style spans to supply additional display and semantic information.

<br />

|          Parameters           ||
|--------|-----------------------|
| `text` | `CharSequence` <br /> |

### setText

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

```
public abstract void setText (CharSequence text, 
                int selectionStart, 
                int selectionEnd)
```

Like[setText(java.lang.CharSequence)](https://developer.android.com/reference/android/view/ViewStructure#setText(java.lang.CharSequence))but with an active selection extending from<var translate="no">selectionStart</var>through<var translate="no">selectionEnd</var>.

<br />

|               Parameters                ||
|------------------|-----------------------|
| `text`           | `CharSequence` <br /> |
| `selectionStart` | `int` <br />          |
| `selectionEnd`   | `int` <br />          |

### setTextIdEntry

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

```
public void setTextIdEntry (String entryName)
```

Sets the identifier used to set the text associated with this view.

Should only be set when the node is used for autofill purposes - it will be ignored when used for Assist.

<br />

|                        Parameters                         ||
|-------------|----------------------------------------------|
| `entryName` | `String`: This value cannot be`null`. <br /> |

### setTextLines

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

```
public abstract void setTextLines (int[] charOffsets, 
                int[] baselines)
```

Set line information for test that was previously supplied through[setText(java.lang.CharSequence)](https://developer.android.com/reference/android/view/ViewStructure#setText(java.lang.CharSequence)). This provides the line breaking of the text as it is shown on screen. This function takes ownership of the provided arrays; you should not make further modification to them.

<br />

|                                                                                          Parameters                                                                                          ||
|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `charOffsets` | `int`: The offset in to[setText(CharSequence)](https://developer.android.com/reference/android/view/ViewStructure#setText(java.lang.CharSequence))where a line starts. <br /> |
| `baselines`   | `int`: The baseline where the line is drawn on screen. <br />                                                                                                                 |

### setTextStyle

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

```
public abstract void setTextStyle (float size, 
                int fgColor, 
                int bgColor, 
                int style)
```

Explicitly set default global style information for text that was previously set with[setText(CharSequence)](https://developer.android.com/reference/android/view/ViewStructure#setText(java.lang.CharSequence)).

<br />

|                                                                             Parameters                                                                              ||
|-----------|----------------------------------------------------------------------------------------------------------------------------------------------------------|
| `size`    | `float`: The size, in pixels, of the text. <br />                                                                                                        |
| `fgColor` | `int`: The foreground color, packed as 0xAARRGGBB. <br />                                                                                                |
| `bgColor` | `int`: The background color, packed as 0xAARRGGBB. <br />                                                                                                |
| `style`   | `int`: Style flags, as defined by[AssistStructure.ViewNode](https://developer.android.com/reference/android/app/assist/AssistStructure.ViewNode). <br /> |

### setTransformation

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

```
public abstract void setTransformation (Matrix matrix)
```

Set the transformation matrix associated with this view, as per[View.getMatrix()](https://developer.android.com/reference/android/view/View#getMatrix()), or null if there is none.

<br />

|        Parameters         ||
|----------|-----------------|
| `matrix` | `Matrix` <br /> |

### setVisibility

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

```
public abstract void setVisibility (int visibility)
```

Set the visibility state of this view, as per[View.getVisibility()](https://developer.android.com/reference/android/view/View#getVisibility()).

<br />

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

### setWebDomain

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

```
public abstract void setWebDomain (String domain)
```

Sets the Web domain represented by this node.

Typically used when the view is a container for an HTML document.

<br />

|                                             Parameters                                              ||
|----------|-------------------------------------------------------------------------------------------|
| `domain` | `String`: RFC 2396-compliant URI representing the domain. This value may be`null`. <br /> |