Added in API level 26

AutofillCallback


abstract class AutofillCallback
kotlin.Any
   ↳ android.view.autofill.AutofillManager.AutofillCallback

Callback for autofill related events.

Typically used for applications that display their own "auto-complete" views, so they can enable / disable such views when the autofill UI is shown / hidden.

Summary

Constants
static Int

The autofill input UI associated with the view was hidden.

static Int

The autofill input UI associated with the view was shown.

static Int

The autofill input UI associated with the view isn't shown because autofill is not available.

Public constructors

Public methods
open Unit
onAutofillEvent(view: View, event: Int)

Called after a change in the autofill state associated with a view.

open Unit
onAutofillEvent(view: View, virtualId: Int, event: Int)

Called after a change in the autofill state associated with a virtual view.

Constants

EVENT_INPUT_HIDDEN

Added in API level 26
static val EVENT_INPUT_HIDDEN: Int

The autofill input UI associated with the view was hidden.

If the view provides its own auto-complete UI that was hidden upon a EVENT_INPUT_SHOWN event, it could be shown again now.

Value: 2

EVENT_INPUT_SHOWN

Added in API level 26
static val EVENT_INPUT_SHOWN: Int

The autofill input UI associated with the view was shown.

If the view provides its own auto-complete UI and its currently shown, it should be hidden upon receiving this event.

Value: 1

EVENT_INPUT_UNAVAILABLE

Added in API level 26
static val EVENT_INPUT_UNAVAILABLE: Int

The autofill input UI associated with the view isn't shown because autofill is not available.

If the view provides its own auto-complete UI but was not displaying it to avoid flickering, it could shown it upon receiving this event.

Value: 3

Public constructors

AutofillCallback

AutofillCallback()

Public methods

onAutofillEvent

Added in API level 26
open fun onAutofillEvent(
    view: View,
    event: Int
): Unit

Called after a change in the autofill state associated with a view.

Parameters
view View: view associated with the change. This value cannot be null.
event Int: currently either EVENT_INPUT_SHOWN or EVENT_INPUT_HIDDEN. Value is android.view.autofill.AutofillManager.AutofillCallback#EVENT_INPUT_SHOWN, android.view.autofill.AutofillManager.AutofillCallback#EVENT_INPUT_HIDDEN, or android.view.autofill.AutofillManager.AutofillCallback#EVENT_INPUT_UNAVAILABLE

onAutofillEvent

Added in API level 26
open fun onAutofillEvent(
    view: View,
    virtualId: Int,
    event: Int
): Unit

Called after a change in the autofill state associated with a virtual view.

Parameters
view View: parent view associated with the change. This value cannot be null.
virtualId Int: id identifying the virtual child inside the parent view.
event Int: currently either EVENT_INPUT_SHOWN or EVENT_INPUT_HIDDEN. Value is android.view.autofill.AutofillManager.AutofillCallback#EVENT_INPUT_SHOWN, android.view.autofill.AutofillManager.AutofillCallback#EVENT_INPUT_HIDDEN, or android.view.autofill.AutofillManager.AutofillCallback#EVENT_INPUT_UNAVAILABLE