# GuidedActionAutofillSupport

Artifact: [androidx.leanback:leanback](https://developer.android.com/jetpack/androidx/releases/leanback) [View Source](https://cs.android.com/search?q=file:androidx/leanback/widget/GuidedActionAutofillSupport.java+class:androidx.leanback.widget.GuidedActionAutofillSupport) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

*** ** * ** ***


```
public interface GuidedActionAutofillSupport
```

<br />

Known direct subclasses [GuidedActionAppCompatEditText](https://developer.android.com/reference/androidx/leanback/widget/GuidedActionAppCompatEditText), [GuidedActionEditText](https://developer.android.com/reference/androidx/leanback/widget/GuidedActionEditText)

|---|---|
| `https://developer.android.com/reference/androidx/leanback/widget/GuidedActionAppCompatEditText` | A custom EditText that satisfies the IME key monitoring requirements of GuidedStepFragment. |
| `https://developer.android.com/reference/androidx/leanback/widget/GuidedActionEditText` | A custom EditText that satisfies the IME key monitoring requirements of GuidedStepFragment. |

*** ** * ** ***

Interface for a custom EditText subclass to support autofill in `https://developer.android.com/reference/androidx/leanback/app/GuidedStepSupportFragment`.

Apps who needs to supply custom layouts for `https://developer.android.com/reference/androidx/leanback/widget/GuidedActionsStylist` with their own EditText classes should implement this interface in order to support autofill in `https://developer.android.com/reference/androidx/leanback/app/GuidedStepSupportFragment`. This ensures autofill event happened within custom EditText is propagated to GuidedStepSupportFragment. e.g.

```
public class MyEditText extends EditText implements GuidedActionAutofillSupport {
    OnAutofillListener mAutofillViewListener;
    @Override
    public void setOnAutofillListener(OnAutofillListener autofillViewListener) {
        mAutofillViewListener = autofillViewListener;
    }

    @Override
    public void autofill(AutofillValue values) {
        super.autofill(values);
        if (mAutofillViewListener != null) {
            mAutofillViewListener.onAutofill(this);
        }
    }
    // ...
}
```

## Summary

| ### Nested types |
|---|
| `public interface https://developer.android.com/reference/androidx/leanback/widget/GuidedActionAutofillSupport.OnAutofillListener` Listener for autofill event. |

| ### Public methods |
|---|---|
| `abstract void` | `https://developer.android.com/reference/androidx/leanback/widget/GuidedActionAutofillSupport#setOnAutofillListener(androidx.leanback.widget.GuidedActionAutofillSupport.OnAutofillListener)( https://developer.android.com/reference/androidx/leanback/widget/GuidedActionAutofillSupport.OnAutofillListener listener )` Sets AutofillListener on the custom view. |

## Public methods

### setOnAutofillListener

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
abstract void setOnAutofillListener(
    GuidedActionAutofillSupport.OnAutofillListener listener
)
```

Sets AutofillListener on the custom view.