Language

SaveInfo.Builder.SetTriggerId(AutofillId) Method

Definition

Explicitly defines the view that should commit the autofill context when clicked.

[Android.Runtime.Register("setTriggerId", "(Landroid/view/autofill/AutofillId;)Landroid/service/autofill/SaveInfo$Builder;", "", ApiSince=28)]
public Android.Service.Autofill.SaveInfo.Builder SetTriggerId(Android.Views.Autofill.AutofillId id);
[<Android.Runtime.Register("setTriggerId", "(Landroid/view/autofill/AutofillId;)Landroid/service/autofill/SaveInfo$Builder;", "", ApiSince=28)>]
member this.SetTriggerId : Android.Views.Autofill.AutofillId -> Android.Service.Autofill.SaveInfo.Builder

Parameters

Returns

Attributes

Remarks

Explicitly defines the view that should commit the autofill context when clicked.

Usually, the save request is only automatically triggered after the activity is finished or all relevant views become invisible, but there are scenarios where the autofill context is automatically commited too late —for example, when the activity manually clears the autofillable views when a button is tapped. This method can be used to trigger the autofill save UI earlier in these scenarios.

Note: This method should only be used in scenarios where the automatic workflow is not enough, otherwise it could trigger the autofill save UI when it should not— for example, when the user entered invalid credentials for the autofillable views.

Android reference for android.service.autofill.SaveInfo.Builder.setTriggerId.

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