# AutofillIdCompat

# 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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/core/view/autofill/AutofillIdCompat "View this page in Java")

<br />

```
class AutofillIdCompat
```

<br />

*** ** * ** ***

Helper for accessing features in[AutofillId](https://developer.android.com/reference/android/view/autofill/AutofillId.html).

## Summary

|                                                     ### Public functions                                                      |
|-------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [AutofillId](https://developer.android.com/reference/android/view/autofill/AutofillId.html)                                   | `@`[RequiresApi](https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi)`(value = 26)` [toAutofillId](https://developer.android.com/reference/kotlin/androidx/core/view/autofill/AutofillIdCompat#toAutofillId())`()` Provides the[AutofillId](https://developer.android.com/reference/android/view/autofill/AutofillId.html)represented by this object.                                                                                                                                                          |
| `java-static `[AutofillIdCompat](https://developer.android.com/reference/kotlin/androidx/core/view/autofill/AutofillIdCompat) | `@`[RequiresApi](https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi)`(value = 26)` [toAutofillIdCompat](https://developer.android.com/reference/kotlin/androidx/core/view/autofill/AutofillIdCompat#toAutofillIdCompat(android.view.autofill.AutofillId))`(autofillId: `[AutofillId](https://developer.android.com/reference/android/view/autofill/AutofillId.html)`)` Provides a backward-compatible wrapper for[AutofillId](https://developer.android.com/reference/android/view/autofill/AutofillId.html). |

## Public functions

### toAutofillId

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

```
@RequiresApi(value = 26)
fun toAutofillId(): AutofillId
```

Provides the[AutofillId](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                                           |
|---------------------------------------------------------------------------------------------|-----------------------|
| [AutofillId](https://developer.android.com/reference/android/view/autofill/AutofillId.html) | platform class object |

|                                                                                See also                                                                                |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [toAutofillIdCompat](https://developer.android.com/reference/kotlin/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)
java-static fun toAutofillIdCompat(autofillId: AutofillId): AutofillIdCompat
```

Provides a backward-compatible wrapper for[AutofillId](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                                                 |
|-----------------------------------------------------------------------------------------------------------|------------------------|
| `autofillId: `[AutofillId](https://developer.android.com/reference/android/view/autofill/AutofillId.html) | platform class to wrap |

|                                                     Returns                                                     |
|-----------------------------------------------------------------------------------------------------------------|---------------|
| [AutofillIdCompat](https://developer.android.com/reference/kotlin/androidx/core/view/autofill/AutofillIdCompat) | wrapped class |