# AutofillIdCompat

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/view/autofill/AutofillIdCompat.java+class:androidx.core.view.autofill.AutofillIdCompat) Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/core#1.11.0)

*** ** * ** ***


```
public class AutofillIdCompat
```

<br />

*** ** * ** ***

Helper for accessing features in `https://developer.android.com/reference/android/view/autofill/AutofillId.html`.

## Summary

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/autofill/AutofillId.html` | `@https://developer.android.com/reference/androidx/annotation/RequiresApi(value = 26) https://developer.android.com/reference/androidx/core/view/autofill/AutofillIdCompat#toAutofillId()()` Provides the `https://developer.android.com/reference/android/view/autofill/AutofillId.html` represented by this object. |
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/autofill/AutofillIdCompat` | `@https://developer.android.com/reference/androidx/annotation/RequiresApi(value = 26) https://developer.android.com/reference/androidx/core/view/autofill/AutofillIdCompat#toAutofillIdCompat(android.view.autofill.AutofillId)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/autofill/AutofillId.html autofillId)` Provides a backward-compatible wrapper for `https://developer.android.com/reference/android/view/autofill/AutofillId.html`. |

## Public methods

### toAutofillId

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

```
@RequiresApi(value = 26)
public @NonNull AutofillId toAutofillId()
```

Provides the `https://developer.android.com/reference/android/view/autofill/AutofillId.html` represented by this object.

This method is not supported on devices running SDK \<26 since the platform class will not be available.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/autofill/AutofillId.html` | platform class object |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/core/view/autofill/AutofillIdCompat#toAutofillIdCompat(android.view.autofill.AutofillId)` |   |

### toAutofillIdCompat

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

```
@RequiresApi(value = 26)
public static @NonNull AutofillIdCompat toAutofillIdCompat(@NonNull AutofillId autofillId)
```

Provides a backward-compatible wrapper for `https://developer.android.com/reference/android/view/autofill/AutofillId.html`.

This method is not supported on devices running SDK \<26 since the platform class will not be available.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/autofill/AutofillId.html autofillId` | platform class to wrap |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/autofill/AutofillIdCompat` | wrapped class |