# AutofillManager.AutofillCallback

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Constants](https://developer.android.com/reference/android/view/autofill/AutofillManager.AutofillCallback#constants)\|[Ctors](https://developer.android.com/reference/android/view/autofill/AutofillManager.AutofillCallback#pubctors)\|[Methods](https://developer.android.com/reference/android/view/autofill/AutofillManager.AutofillCallback#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/view/autofill/AutofillManager.AutofillCallback#inhmethods)  

# AutofillManager.AutofillCallback

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/view/autofill/AutofillManager.AutofillCallback "View this page in Kotlin")\|Java

`
public
static

abstract
class
AutofillManager.AutofillCallback
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|--------------------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.view.autofill.AutofillManager.AutofillCallback |

<br />

*** ** * ** ***

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                                                                                                                      ||
|-------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [EVENT_INPUT_HIDDEN](https://developer.android.com/reference/android/view/autofill/AutofillManager.AutofillCallback#EVENT_INPUT_HIDDEN) The autofill input UI associated with the view was hidden.                                              |
| `int` | [EVENT_INPUT_SHOWN](https://developer.android.com/reference/android/view/autofill/AutofillManager.AutofillCallback#EVENT_INPUT_SHOWN) The autofill input UI associated with the view was shown.                                                 |
| `int` | [EVENT_INPUT_UNAVAILABLE](https://developer.android.com/reference/android/view/autofill/AutofillManager.AutofillCallback#EVENT_INPUT_UNAVAILABLE) The autofill input UI associated with the view isn't shown because autofill is not available. |

|                                                             ### Public constructors                                                              ||
|-----------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[AutofillCallback](https://developer.android.com/reference/android/view/autofill/AutofillManager.AutofillCallback#AutofillCallback())`() ` |

|                                                                                                                                                                        ### Public methods                                                                                                                                                                         ||
|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` void` | ` `[onAutofillEvent](https://developer.android.com/reference/android/view/autofill/AutofillManager.AutofillCallback#onAutofillEvent(android.view.View,%20int,%20int))`(`[View](https://developer.android.com/reference/android/view/View)` view, int virtualId, int event) ` Called after a change in the autofill state associated with a virtual view. |
| ` void` | ` `[onAutofillEvent](https://developer.android.com/reference/android/view/autofill/AutofillManager.AutofillCallback#onAutofillEvent(android.view.View,%20int))`(`[View](https://developer.android.com/reference/android/view/View)` view, int event) ` Called after a change in the autofill state associated with a view.                               |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Constants

### EVENT_INPUT_HIDDEN

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int EVENT_INPUT_HIDDEN
```

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](https://developer.android.com/reference/android/view/autofill/AutofillManager.AutofillCallback#EVENT_INPUT_SHOWN)event, it could be shown again now.

<br />

Constant Value: 2 (0x00000002)  

### EVENT_INPUT_SHOWN

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int EVENT_INPUT_SHOWN
```

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.

<br />

Constant Value: 1 (0x00000001)  

### EVENT_INPUT_UNAVAILABLE

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int EVENT_INPUT_UNAVAILABLE
```

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.

<br />

Constant Value: 3 (0x00000003)

## Public constructors

### AutofillCallback

```
public AutofillCallback ()
```

<br />

<br />

## Public methods

### onAutofillEvent

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void onAutofillEvent (View view, 
                int virtualId, 
                int event)
```

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

<br />

|                                                                                                                                                                                                                                                                                                                                                                              Parameters                                                                                                                                                                                                                                                                                                                                                                               ||
|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `view`      | `View`: parent view associated with the change. This value cannot be`null`. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `virtualId` | `int`: id identifying the virtual child inside the parent view. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `event`     | `int`: currently either[EVENT_INPUT_SHOWN](https://developer.android.com/reference/android/view/autofill/AutofillManager.AutofillCallback#EVENT_INPUT_SHOWN)or[EVENT_INPUT_HIDDEN](https://developer.android.com/reference/android/view/autofill/AutofillManager.AutofillCallback#EVENT_INPUT_HIDDEN). Value is[EVENT_INPUT_SHOWN](https://developer.android.com/reference/android/view/autofill/AutofillManager.AutofillCallback#EVENT_INPUT_SHOWN),[EVENT_INPUT_HIDDEN](https://developer.android.com/reference/android/view/autofill/AutofillManager.AutofillCallback#EVENT_INPUT_HIDDEN), or[EVENT_INPUT_UNAVAILABLE](https://developer.android.com/reference/android/view/autofill/AutofillManager.AutofillCallback#EVENT_INPUT_UNAVAILABLE) <br /> |

### onAutofillEvent

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void onAutofillEvent (View view, 
                int event)
```

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

<br />

|                                                                                                                                                                                                                                                                                                                                                                            Parameters                                                                                                                                                                                                                                                                                                                                                                             ||
|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `view`  | `View`: view associated with the change. This value cannot be`null`. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `event` | `int`: currently either[EVENT_INPUT_SHOWN](https://developer.android.com/reference/android/view/autofill/AutofillManager.AutofillCallback#EVENT_INPUT_SHOWN)or[EVENT_INPUT_HIDDEN](https://developer.android.com/reference/android/view/autofill/AutofillManager.AutofillCallback#EVENT_INPUT_HIDDEN). Value is[EVENT_INPUT_SHOWN](https://developer.android.com/reference/android/view/autofill/AutofillManager.AutofillCallback#EVENT_INPUT_SHOWN),[EVENT_INPUT_HIDDEN](https://developer.android.com/reference/android/view/autofill/AutofillManager.AutofillCallback#EVENT_INPUT_HIDDEN), or[EVENT_INPUT_UNAVAILABLE](https://developer.android.com/reference/android/view/autofill/AutofillManager.AutofillCallback#EVENT_INPUT_UNAVAILABLE) <br /> |