Sdílet prostřednictvím


View.ImportantForAutofill Property

Definition

Gets the mode for determining whether this view is important for autofill. -or- Sets the mode for determining whether this view is considered important for autofill.

public virtual Android.Views.ImportantForAutofill ImportantForAutofill { [Android.Runtime.Register("getImportantForAutofill", "()I", "GetGetImportantForAutofillHandler", ApiSince=26)] get; [Android.Runtime.Register("setImportantForAutofill", "(I)V", "GetSetImportantForAutofill_IHandler", ApiSince=26)] set; }
[<get: Android.Runtime.Register("getImportantForAutofill", "()I", "GetGetImportantForAutofillHandler", ApiSince=26)>]
[<set: Android.Runtime.Register("setImportantForAutofill", "(I)V", "GetSetImportantForAutofill_IHandler", ApiSince=26)>]
member this.ImportantForAutofill : Android.Views.ImportantForAutofill with get, set

Property Value

#IMPORTANT_FOR_AUTOFILL_AUTO by default, or value passed to #setImportantForAutofill(int).

Attributes

Remarks

Property getter documentation:

Gets the mode for determining whether this view is important for autofill.

See #setImportantForAutofill(int) and #isImportantForAutofill() for more info about this mode.

Java documentation for android.view.View.getImportantForAutofill().

Property setter documentation:

Sets the mode for determining whether this view is considered important for autofill.

The platform determines the importance for autofill automatically but you can use this method to customize the behavior. For example:

<ol> <li>When the view contents is irrelevant for autofill (for example, a text field used in a "Captcha" challenge), it should be #IMPORTANT_FOR_AUTOFILL_NO. <li>When both the view and its children are irrelevant for autofill (for example, the root view of an activity containing a spreadhseet editor), it should be #IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS. <li>When the view content is relevant for autofill but its children aren't (for example, a credit card expiration date represented by a custom view that overrides the proper autofill methods and has 2 children representing the month and year), it should be #IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS. </ol>

<b>Note:</b> Setting the mode as #IMPORTANT_FOR_AUTOFILL_NO or #IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS does not guarantee the view (and its children) will not be used for autofill purpose; for example, when the user explicitly makes an autofill request, all views are included in the ViewStructure, and starting in android.os.Build.VERSION_CODES#UPSIDE_DOWN_CAKE the system uses other factors along with importance to determine the autofill behavior. See #isImportantForAutofill() for more details about how the View's importance for autofill is used.

Java documentation for android.view.View.setImportantForAutofill(int).

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