Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
A builder for Field
Summary
Public methods |
Field |
Builds the instance.
|
Field.Builder |
Regex used to determine if the dataset should be shown in the autofill UI; when null , it disables filtering on that dataset (this is the recommended approach when value is not null and field contains sensitive data such as passwords).
|
Field.Builder |
The presentations used to visualize this field in Autofill UI.
|
Field.Builder |
The value to be autofilled.
|
Public constructors
Public methods
build
fun build(): Field
Builds the instance. This builder should not be touched after calling this!
Return |
Field |
This value cannot be null . |
setFilter
fun setFilter(value: Pattern?): Field.Builder
Regex used to determine if the dataset should be shown in the autofill UI; when null
, it disables filtering on that dataset (this is the recommended approach when value
is not null
and field contains sensitive data such as passwords).
Parameters |
value |
Pattern?: This value may be null . |
setPresentations
fun setPresentations(value: Presentations): Field.Builder
The presentations used to visualize this field in Autofill UI.
setValue
fun setValue(value: AutofillValue): Field.Builder
The value to be autofilled. Pass null
if you do not have the value but the target view is a logical part of the dataset. For example, if the dataset needs authentication and you have no access to the value.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# Field.Builder\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBuilder\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/service/autofill/Field.Builder \"View this page in Java\") \n\n```\nclass Builder\n```\n\n|---|---------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.service.autofill.Field.Builder](#) |\n\nA builder for [Field](/reference/kotlin/android/service/autofill/Field)\n\nSummary\n-------\n\n| Public constructors ||\n|----------------------------------|---|\n| [Builder](#Builder())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|-----------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Field](/reference/kotlin/android/service/autofill/Field) | [build](#build())`()` Builds the instance. |\n| [Field.Builder](#) | [setFilter](#setFilter(java.util.regex.Pattern))`(`value:` `[Pattern](../../../java/util/regex/Pattern.html#)?`)` Regex used to determine if the dataset should be shown in the autofill UI; when `null`, it disables filtering on that dataset (this is the recommended approach when `value` is not `null` and field contains sensitive data such as passwords). |\n| [Field.Builder](#) | [setPresentations](#setPresentations(android.service.autofill.Presentations))`(`value:` `[Presentations](/reference/kotlin/android/service/autofill/Presentations)`)` The presentations used to visualize this field in Autofill UI. |\n| [Field.Builder](#) | [setValue](#setValue(android.view.autofill.AutofillValue))`(`value:` `[AutofillValue](../../view/autofill/AutofillValue.html#)`)` The value to be autofilled. |\n\nPublic constructors\n-------------------\n\n### Builder\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nBuilder()\n```\n\nPublic methods\n--------------\n\n### build\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun build(): Field\n```\n\nBuilds the instance. This builder should not be touched after calling this!\n\n| Return ||\n|-----------------------------------------------------------|------------------------------|\n| [Field](/reference/kotlin/android/service/autofill/Field) | This value cannot be `null`. |\n\n### setFilter\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setFilter(value: Pattern?): Field.Builder\n```\n\nRegex used to determine if the dataset should be shown in the autofill UI; when `null`, it disables filtering on that dataset (this is the recommended approach when `value` is not `null` and field contains sensitive data such as passwords).\n\n| Parameters ||\n|---------|-------------------------------------------------------------------------------|\n| `value` | [Pattern](../../../java/util/regex/Pattern.html#)?: This value may be `null`. |\n\n### setPresentations\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setPresentations(value: Presentations): Field.Builder\n```\n\nThe presentations used to visualize this field in Autofill UI.\n\n| Parameters ||\n|---------|---------------------------------------------------------------------------------------------------------|\n| `value` | [Presentations](/reference/kotlin/android/service/autofill/Presentations): This value cannot be `null`. |\n\n| Return ||\n|--------------------|------------------------------|\n| [Field.Builder](#) | This value cannot be `null`. |\n\n### setValue\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setValue(value: AutofillValue): Field.Builder\n```\n\nThe value to be autofilled. Pass `null` if you do not have the value but the target view is a logical part of the dataset. For example, if the dataset needs authentication and you have no access to the value.\n\n| Parameters ||\n|---------|----------------------------------------------------------------------------------------|\n| `value` | [AutofillValue](../../view/autofill/AutofillValue.html#): This value cannot be `null`. |"]]