{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

Autofill

@ExperimentalComposeUiApi
public interface Autofill


Autofill API.

This interface is available to all composables via a CompositionLocal. The composable can then request or cancel autofill as required. For instance, the TextField can call requestAutofillForNode when it gains focus, and cancelAutofillForNode when it loses focus.

Summary

Public methods

abstract void

Cancel a previously supplied autofill request.

abstract void

Request autofill for the specified node.

Public methods

cancelAutofillForNode

abstract void cancelAutofillForNode(@NonNull AutofillNode autofillNode)

Cancel a previously supplied autofill request.

Parameters
@NonNull AutofillNode autofillNode

The node that needs to be autofilled.

This function is usually called when an autofillable component loses focus.

requestAutofillForNode

abstract void requestAutofillForNode(@NonNull AutofillNode autofillNode)

Request autofill for the specified node.

Parameters
@NonNull AutofillNode autofillNode

The node that needs to be autofilled.

This function is usually called when an autofillable component gains focus.