autofillHints property

Iterable<String> autofillHints

A list of strings that helps the autofill service identify the type of this text input.

When set to null or empty, the text input will not send any autofill related information to the platform. As a result, it will not participate in autofills triggered by a different AutofillClient, even if they're in the same AutofillScope. Additionally, on Android and web, setting this to null or empty will disable autofill for this text field.

The minimum platform SDK version that supports Autofill is API level 26 for Android, and iOS 10.0 for iOS.

iOS-specific Concerns:

To provide the best user experience and ensure your app fully supports password autofill on iOS, follow these steps:

If an autofillable input field needs to use a custom hint that translates to different strings on different platforms, the easiest way to achieve that is to return different hint strings based on the value of defaultTargetPlatform.

Each hint in the list, if not ignored, will be translated to the platform's autofill hint type understood by its autofill services:

  • On iOS, only the first hint in the list is accounted for. The hint will be translated to a UITextContentType.

  • On Android, all hints in the list are translated to Android hint strings.

  • On web, only the first hint is accounted for and will be translated to an "autocomplete" string.

Providing an autofill hint that is predefined on the platform does not automatically grant the input field eligibility for autofill. Ultimately, it comes down to the autofill service currently in charge to determine whether an input field is suitable for autofill and what the autofill candidates are.

See also:


final Iterable<String> autofillHints