Share via


View.AutofillHintCreditCardExpirationDate Field

Definition

Hint indicating that this view can be autofilled with a credit card expiration date.

[Android.Runtime.Register("AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE", ApiSince=26)]
public const string AutofillHintCreditCardExpirationDate;
[<Android.Runtime.Register("AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE", ApiSince=26)>]
val mutable AutofillHintCreditCardExpirationDate : string

Field Value

Attributes

Remarks

Hint indicating that this view can be autofilled with a credit card expiration date.

It should be used when the credit card expiration date is represented by just one view; if it is represented by more than one (for example, one view for the month and another view for the year), then each of these views should use the hint specific for the unit (#AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY, #AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH, or #AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR).

Can be used with either #setAutofillHints(String[]) or <c>android:autofillHint</c> (in which case the value should be {@value #AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE}).

When annotating a view with this hint, it's recommended to use a date autofill value to avoid ambiguity when the autofill service provides a value for it. To understand why a value can be ambiguous, consider "April of 2020", which could be represented as either of the following options:

<ul> <li>"04/2020"<li>"4/2020"<li>"2020/04"<li>"2020/4"<li>"April/2020"<li>"Apr/2020"</ul>

You define a date autofill value for the view by overriding the following methods:

<ol> <li>#getAutofillType() to return #AUTOFILL_TYPE_DATE. <li>#getAutofillValue() to return a AutofillValue#forDate(long) date autofillvalue. <li>#autofill(AutofillValue) to expect a data autofillvalue. </ol>

See #setAutofillHints(String...) for more info about autofill hints.

Java documentation for android.view.View.AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE.

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