Dataset.Builder.SetValue Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| SetValue(AutofillId, AutofillValue) |
Sets the value of a field. |
| SetValue(AutofillId, AutofillValue, RemoteViews) |
Sets the value of a field, using a custom presentation to visualize it. |
| SetValue(AutofillId, AutofillValue, Pattern) |
Sets the value of a field using an explicit filter. |
| SetValue(AutofillId, AutofillValue, RemoteViews, InlinePresentation) |
Sets the value of a field, using a custom presentation to visualize it and an InlinePresentation to visualize it as an inline suggestion. |
| SetValue(AutofillId, AutofillValue, Pattern, RemoteViews) |
Sets the value of a field, using a custom presentation to visualize it and a explicit filter. |
| SetValue(AutofillId, AutofillValue, RemoteViews, InlinePresentation, InlinePresentation) |
Sets the value of a field, using a custom presentation to visualize it and an InlinePresentation to visualize it as an inline suggestion. |
| SetValue(AutofillId, AutofillValue, Pattern, RemoteViews, InlinePresentation) |
Sets the value of a field, using a custom presentation to visualize it and a explicit filter, and an InlinePresentation to visualize it as an inline suggestion. |
| SetValue(AutofillId, AutofillValue, Pattern, RemoteViews, InlinePresentation, InlinePresentation) |
Sets the value of a field, using a custom presentation to visualize it and a explicit filter, and an InlinePresentation to visualize it as an inline suggestion. |
SetValue(AutofillId, AutofillValue)
Sets the value of a field.
[Android.Runtime.Register("setValue", "(Landroid/view/autofill/AutofillId;Landroid/view/autofill/AutofillValue;)Landroid/service/autofill/Dataset$Builder;", "", ApiSince=26)]
public Android.Service.Autofill.Dataset.Builder SetValue(Android.Views.Autofill.AutofillId id, Android.Views.Autofill.AutofillValue? value);
[<Android.Runtime.Register("setValue", "(Landroid/view/autofill/AutofillId;Landroid/view/autofill/AutofillValue;)Landroid/service/autofill/Dataset$Builder;", "", ApiSince=26)>]
member this.SetValue : Android.Views.Autofill.AutofillId * Android.Views.Autofill.AutofillValue -> Android.Service.Autofill.Dataset.Builder
Parameters
- id
- AutofillId
id returned by AssistStructure.ViewNode.getAutofillId(). This value cannot be null.
- value
- AutofillValue
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.
Returns
this builder. This value cannot be null.
- Attributes
Remarks
This method was deprecated in API level 33. Use setField(AutofillId,Field) instead.
Sets the value of a field. Note: Prior to Android Build.VERSION_CODES.P, this method would throw an IllegalStateException if this builder was constructed without a presentation. Android Build.VERSION_CODES.P and higher removed this restriction because datasets used as an authentication result do not need a presentation. But if you don't set the presentation in the constructor in a dataset that is meant to be shown to the user, the autofill UI for this field will not be displayed.
Note: On Android Build.VERSION_CODES.P and higher, datasets that require authentication can be also be filtered by passing a text value as the value parameter.
Android reference for android.service.autofill.Dataset.Builder.setValue.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
SetValue(AutofillId, AutofillValue, RemoteViews)
Sets the value of a field, using a custom presentation to visualize it.
[Android.Runtime.Register("setValue", "(Landroid/view/autofill/AutofillId;Landroid/view/autofill/AutofillValue;Landroid/widget/RemoteViews;)Landroid/service/autofill/Dataset$Builder;", "", ApiSince=26)]
public Android.Service.Autofill.Dataset.Builder SetValue(Android.Views.Autofill.AutofillId id, Android.Views.Autofill.AutofillValue? value, Android.Widget.RemoteViews presentation);
[<Android.Runtime.Register("setValue", "(Landroid/view/autofill/AutofillId;Landroid/view/autofill/AutofillValue;Landroid/widget/RemoteViews;)Landroid/service/autofill/Dataset$Builder;", "", ApiSince=26)>]
member this.SetValue : Android.Views.Autofill.AutofillId * Android.Views.Autofill.AutofillValue * Android.Widget.RemoteViews -> Android.Service.Autofill.Dataset.Builder
Parameters
- id
- AutofillId
id returned by AssistStructure.ViewNode.getAutofillId(). This value cannot be null.
- value
- AutofillValue
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.
- presentation
- RemoteViews
the presentation used to visualize this field. This value cannot be null.
Returns
this builder. This value cannot be null.
- Attributes
Remarks
This method was deprecated in API level 33. Use setField(AutofillId,Field) instead.
Sets the value of a field, using a custom presentation to visualize it.
Note: On Android Build.VERSION_CODES.P and higher, datasets that require authentication can be also be filtered by passing a text value as the value parameter.
Theme does not work with RemoteViews layout. Avoid hardcoded text color or background color: Autofill on different platforms may have different themes.
Android reference for android.service.autofill.Dataset.Builder.setValue.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
SetValue(AutofillId, AutofillValue, Pattern)
Sets the value of a field using an explicit filter.
[Android.Runtime.Register("setValue", "(Landroid/view/autofill/AutofillId;Landroid/view/autofill/AutofillValue;Ljava/util/regex/Pattern;)Landroid/service/autofill/Dataset$Builder;", "", ApiSince=28)]
public Android.Service.Autofill.Dataset.Builder SetValue(Android.Views.Autofill.AutofillId id, Android.Views.Autofill.AutofillValue? value, Java.Util.Regex.Pattern? filter);
[<Android.Runtime.Register("setValue", "(Landroid/view/autofill/AutofillId;Landroid/view/autofill/AutofillValue;Ljava/util/regex/Pattern;)Landroid/service/autofill/Dataset$Builder;", "", ApiSince=28)>]
member this.SetValue : Android.Views.Autofill.AutofillId * Android.Views.Autofill.AutofillValue * Java.Util.Regex.Pattern -> Android.Service.Autofill.Dataset.Builder
Parameters
- id
- AutofillId
id returned by AssistStructure.ViewNode.getAutofillId(). This value cannot be null.
- value
- AutofillValue
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.
- filter
- Pattern
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).
Returns
this builder. This value cannot be null.
- Attributes
Remarks
This method was deprecated in API level 33. Use setField(AutofillId,Field) instead.
Sets the value of a field using an explicit filter.
This method is typically used when the dataset requires authentication and the service does not know its value but wants to hide the dataset after the user enters a minimum number of characters. For example, if the dataset represents a credit card number and the service does not want to show the "Tap to authenticate" message until the user tapped 4 digits, in which case the filter would be Pattern.compile("\\d.{4,}").
Note: If the dataset requires authentication but the service knows its text value it's easier to filter by calling setValue(AutofillId,AutofillValue) and use the value to filter.
Android reference for android.service.autofill.Dataset.Builder.setValue.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
SetValue(AutofillId, AutofillValue, RemoteViews, InlinePresentation)
Sets the value of a field, using a custom presentation to visualize it and an InlinePresentation to visualize it as an inline suggestion.
[Android.Runtime.Register("setValue", "(Landroid/view/autofill/AutofillId;Landroid/view/autofill/AutofillValue;Landroid/widget/RemoteViews;Landroid/service/autofill/InlinePresentation;)Landroid/service/autofill/Dataset$Builder;", "", ApiSince=30)]
public Android.Service.Autofill.Dataset.Builder SetValue(Android.Views.Autofill.AutofillId id, Android.Views.Autofill.AutofillValue? value, Android.Widget.RemoteViews presentation, Android.Service.Autofill.InlinePresentation inlinePresentation);
[<Android.Runtime.Register("setValue", "(Landroid/view/autofill/AutofillId;Landroid/view/autofill/AutofillValue;Landroid/widget/RemoteViews;Landroid/service/autofill/InlinePresentation;)Landroid/service/autofill/Dataset$Builder;", "", ApiSince=30)>]
member this.SetValue : Android.Views.Autofill.AutofillId * Android.Views.Autofill.AutofillValue * Android.Widget.RemoteViews * Android.Service.Autofill.InlinePresentation -> Android.Service.Autofill.Dataset.Builder
Parameters
- id
- AutofillId
id returned by AssistStructure.ViewNode.getAutofillId(). This value cannot be null.
- value
- AutofillValue
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.
- presentation
- RemoteViews
the presentation used to visualize this field. This value cannot be null.
- inlinePresentation
- InlinePresentation
The InlinePresentation used to visualize this dataset as inline suggestions. If the dataset supports inline suggestions, this should not be null.
Returns
this builder. This value cannot be null.
- Attributes
Remarks
This method was deprecated in API level 33. Use setField(AutofillId,Field) instead.
Sets the value of a field, using a custom presentation to visualize it and an InlinePresentation to visualize it as an inline suggestion.
Note: If the dataset requires authentication but the service knows its text value it's easier to filter by calling setValue(AutofillId,AutofillValue,RemoteViews) and using the value to filter.
Android reference for android.service.autofill.Dataset.Builder.setValue.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
SetValue(AutofillId, AutofillValue, Pattern, RemoteViews)
Sets the value of a field, using a custom presentation to visualize it and a explicit filter.
[Android.Runtime.Register("setValue", "(Landroid/view/autofill/AutofillId;Landroid/view/autofill/AutofillValue;Ljava/util/regex/Pattern;Landroid/widget/RemoteViews;)Landroid/service/autofill/Dataset$Builder;", "", ApiSince=28)]
public Android.Service.Autofill.Dataset.Builder SetValue(Android.Views.Autofill.AutofillId id, Android.Views.Autofill.AutofillValue? value, Java.Util.Regex.Pattern? filter, Android.Widget.RemoteViews presentation);
[<Android.Runtime.Register("setValue", "(Landroid/view/autofill/AutofillId;Landroid/view/autofill/AutofillValue;Ljava/util/regex/Pattern;Landroid/widget/RemoteViews;)Landroid/service/autofill/Dataset$Builder;", "", ApiSince=28)>]
member this.SetValue : Android.Views.Autofill.AutofillId * Android.Views.Autofill.AutofillValue * Java.Util.Regex.Pattern * Android.Widget.RemoteViews -> Android.Service.Autofill.Dataset.Builder
Parameters
- id
- AutofillId
id returned by AssistStructure.ViewNode.getAutofillId(). This value cannot be null.
- value
- AutofillValue
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.
- filter
- Pattern
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).
- presentation
- RemoteViews
the presentation used to visualize this field. This value cannot be null.
Returns
this builder. This value cannot be null.
- Attributes
Remarks
This method was deprecated in API level 33. Use setField(AutofillId,Field) instead.
Sets the value of a field, using a custom presentation to visualize it and a explicit filter.
This method is typically used when the dataset requires authentication and the service does not know its value but wants to hide the dataset after the user enters a minimum number of characters. For example, if the dataset represents a credit card number and the service does not want to show the "Tap to authenticate" message until the user tapped 4 digits, in which case the filter would be Pattern.compile("\\d.{4,}").
Note: If the dataset requires authentication but the service knows its text value it's easier to filter by calling setValue(AutofillId,AutofillValue,RemoteViews) and using the value to filter.
Android reference for android.service.autofill.Dataset.Builder.setValue.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
SetValue(AutofillId, AutofillValue, RemoteViews, InlinePresentation, InlinePresentation)
Sets the value of a field, using a custom presentation to visualize it and an InlinePresentation to visualize it as an inline suggestion.
[Android.Runtime.Register("setValue", "(Landroid/view/autofill/AutofillId;Landroid/view/autofill/AutofillValue;Landroid/widget/RemoteViews;Landroid/service/autofill/InlinePresentation;Landroid/service/autofill/InlinePresentation;)Landroid/service/autofill/Dataset$Builder;", "", ApiSince=31)]
public Android.Service.Autofill.Dataset.Builder SetValue(Android.Views.Autofill.AutofillId id, Android.Views.Autofill.AutofillValue? value, Android.Widget.RemoteViews presentation, Android.Service.Autofill.InlinePresentation inlinePresentation, Android.Service.Autofill.InlinePresentation inlineTooltipPresentation);
[<Android.Runtime.Register("setValue", "(Landroid/view/autofill/AutofillId;Landroid/view/autofill/AutofillValue;Landroid/widget/RemoteViews;Landroid/service/autofill/InlinePresentation;Landroid/service/autofill/InlinePresentation;)Landroid/service/autofill/Dataset$Builder;", "", ApiSince=31)>]
member this.SetValue : Android.Views.Autofill.AutofillId * Android.Views.Autofill.AutofillValue * Android.Widget.RemoteViews * Android.Service.Autofill.InlinePresentation * Android.Service.Autofill.InlinePresentation -> Android.Service.Autofill.Dataset.Builder
Parameters
- id
- AutofillId
id returned by AssistStructure.ViewNode.getAutofillId(). This value cannot be null.
- value
- AutofillValue
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.
- presentation
- RemoteViews
the presentation used to visualize this field. This value cannot be null.
- inlinePresentation
- InlinePresentation
The InlinePresentation used to visualize this dataset as inline suggestions. If the dataset supports inline suggestions, this should not be null.
- inlineTooltipPresentation
- InlinePresentation
The InlinePresentation used to show the tooltip for the inlinePresentation. This value cannot be null.
Returns
this builder. This value cannot be null.
- Attributes
Remarks
This method was deprecated in API level 33. Use setField(AutofillId,Field) instead.
Sets the value of a field, using a custom presentation to visualize it and an InlinePresentation to visualize it as an inline suggestion.
Android reference for android.service.autofill.Dataset.Builder.setValue.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
SetValue(AutofillId, AutofillValue, Pattern, RemoteViews, InlinePresentation)
Sets the value of a field, using a custom presentation to visualize it and a explicit filter, and an InlinePresentation to visualize it as an inline suggestion.
[Android.Runtime.Register("setValue", "(Landroid/view/autofill/AutofillId;Landroid/view/autofill/AutofillValue;Ljava/util/regex/Pattern;Landroid/widget/RemoteViews;Landroid/service/autofill/InlinePresentation;)Landroid/service/autofill/Dataset$Builder;", "", ApiSince=30)]
public Android.Service.Autofill.Dataset.Builder SetValue(Android.Views.Autofill.AutofillId id, Android.Views.Autofill.AutofillValue? value, Java.Util.Regex.Pattern? filter, Android.Widget.RemoteViews presentation, Android.Service.Autofill.InlinePresentation inlinePresentation);
[<Android.Runtime.Register("setValue", "(Landroid/view/autofill/AutofillId;Landroid/view/autofill/AutofillValue;Ljava/util/regex/Pattern;Landroid/widget/RemoteViews;Landroid/service/autofill/InlinePresentation;)Landroid/service/autofill/Dataset$Builder;", "", ApiSince=30)>]
member this.SetValue : Android.Views.Autofill.AutofillId * Android.Views.Autofill.AutofillValue * Java.Util.Regex.Pattern * Android.Widget.RemoteViews * Android.Service.Autofill.InlinePresentation -> Android.Service.Autofill.Dataset.Builder
Parameters
- id
- AutofillId
id returned by AssistStructure.ViewNode.getAutofillId(). This value cannot be null.
- value
- AutofillValue
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.
- filter
- Pattern
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).
- presentation
- RemoteViews
the presentation used to visualize this field. This value cannot be null.
- inlinePresentation
- InlinePresentation
The InlinePresentation used to visualize this dataset as inline suggestions. If the dataset supports inline suggestions, this should not be null.
Returns
this builder. This value cannot be null.
- Attributes
Remarks
This method was deprecated in API level 33. Use setField(AutofillId,Field) instead.
Sets the value of a field, using a custom presentation to visualize it and a explicit filter, and an InlinePresentation to visualize it as an inline suggestion.
This method is typically used when the dataset requires authentication and the service does not know its value but wants to hide the dataset after the user enters a minimum number of characters. For example, if the dataset represents a credit card number and the service does not want to show the "Tap to authenticate" message until the user tapped 4 digits, in which case the filter would be Pattern.compile("\\d.{4,}").
Note: If the dataset requires authentication but the service knows its text value it's easier to filter by calling setValue(AutofillId,AutofillValue,RemoteViews) and using the value to filter.
Android reference for android.service.autofill.Dataset.Builder.setValue.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
SetValue(AutofillId, AutofillValue, Pattern, RemoteViews, InlinePresentation, InlinePresentation)
Sets the value of a field, using a custom presentation to visualize it and a explicit filter, and an InlinePresentation to visualize it as an inline suggestion.
[Android.Runtime.Register("setValue", "(Landroid/view/autofill/AutofillId;Landroid/view/autofill/AutofillValue;Ljava/util/regex/Pattern;Landroid/widget/RemoteViews;Landroid/service/autofill/InlinePresentation;Landroid/service/autofill/InlinePresentation;)Landroid/service/autofill/Dataset$Builder;", "", ApiSince=31)]
public Android.Service.Autofill.Dataset.Builder SetValue(Android.Views.Autofill.AutofillId id, Android.Views.Autofill.AutofillValue? value, Java.Util.Regex.Pattern? filter, Android.Widget.RemoteViews presentation, Android.Service.Autofill.InlinePresentation inlinePresentation, Android.Service.Autofill.InlinePresentation inlineTooltipPresentation);
[<Android.Runtime.Register("setValue", "(Landroid/view/autofill/AutofillId;Landroid/view/autofill/AutofillValue;Ljava/util/regex/Pattern;Landroid/widget/RemoteViews;Landroid/service/autofill/InlinePresentation;Landroid/service/autofill/InlinePresentation;)Landroid/service/autofill/Dataset$Builder;", "", ApiSince=31)>]
member this.SetValue : Android.Views.Autofill.AutofillId * Android.Views.Autofill.AutofillValue * Java.Util.Regex.Pattern * Android.Widget.RemoteViews * Android.Service.Autofill.InlinePresentation * Android.Service.Autofill.InlinePresentation -> Android.Service.Autofill.Dataset.Builder
Parameters
- id
- AutofillId
id returned by AssistStructure.ViewNode.getAutofillId(). This value cannot be null.
- value
- AutofillValue
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.
- filter
- Pattern
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).
- presentation
- RemoteViews
the presentation used to visualize this field. This value cannot be null.
- inlinePresentation
- InlinePresentation
The InlinePresentation used to visualize this dataset as inline suggestions. If the dataset supports inline suggestions, this should not be null.
- inlineTooltipPresentation
- InlinePresentation
The InlinePresentation used to show the tooltip for the inlinePresentation. This value cannot be null.
Returns
this builder. This value cannot be null.
- Attributes
Remarks
This method was deprecated in API level 33. Use setField(AutofillId,Field) instead.
Sets the value of a field, using a custom presentation to visualize it and a explicit filter, and an InlinePresentation to visualize it as an inline suggestion.
Android reference for android.service.autofill.Dataset.Builder.setValue.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.