# CreateCredentialRequest.DisplayInfo

Artifact: [androidx.credentials:credentials](https://developer.android.com/jetpack/androidx/releases/credentials) [View Source](https://cs.android.com/search?q=file:androidx/credentials/CreateCredentialRequest.kt+class:androidx.credentials.CreateCredentialRequest.DisplayInfo) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/credentials#1.2.0)

*** ** * ** ***

<br />

```
class CreateCredentialRequest.DisplayInfo
```

<br />

*** ** * ** ***

Information that may be used for display purposes when rendering UIs to collect the user consent and choice.

## Summary

| ### Public companion functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest.DisplayInfo` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi(value = 23) https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest.DisplayInfo#createFrom(android.os.Bundle)(from: https://developer.android.com/reference/android/os/Bundle.html)` Returns a RequestDisplayInfo from a `https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest#credentialData()` Bundle. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest.DisplayInfo#DisplayInfo(kotlin.CharSequence,kotlin.CharSequence)(userId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html, userDisplayName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html?)` Constructs a `https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest.DisplayInfo`. |
| `https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest.DisplayInfo#DisplayInfo(kotlin.CharSequence,kotlin.CharSequence,kotlin.String)( userId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html, userDisplayName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html?, preferDefaultProvider: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html? )` Constructs a `https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest.DisplayInfo`. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html?` | `https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest.DisplayInfo#userDisplayName()` an optional display name in addition to the `https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest.DisplayInfo#userId()` that may be displayed next to the `userId` during the user consent to help your user better understand the credential being created |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` | `https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest.DisplayInfo#userId()` the user identifier of the created credential |

## Public companion functions

### createFrom

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

```
@RequiresApi(value = 23)
fun createFrom(from: Bundle): CreateCredentialRequest.DisplayInfo
```

Returns a RequestDisplayInfo from a `https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest#credentialData()` Bundle.

It is recommended to construct a DisplayInfo by direct constructor calls, instead of using this API. This API should only be used by a small subset of system apps that reconstruct an existing object for user interactions such as collecting consents.

| Parameters |
|---|---|
| `from: https://developer.android.com/reference/android/os/Bundle.html` | the raw display data in the Bundle format, retrieved from `https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest#credentialData()` |

## Public constructors

### DisplayInfo

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

```
DisplayInfo(userId: CharSequence, userDisplayName: CharSequence? = null)
```

Constructs a `https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest.DisplayInfo`.

| Parameters |
|---|---|
| `userId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` | the user id of the created credential |
| `userDisplayName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html? = null` | an optional display name in addition to the `https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest.DisplayInfo#(kotlin.CharSequence,kotlin.CharSequence)` that may be displayed next to the `userId` during the user consent to help your user better understand the credential being created |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | If `https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest.DisplayInfo#(kotlin.CharSequence,kotlin.CharSequence)` is empty |

### DisplayInfo

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

```
DisplayInfo(
    userId: CharSequence,
    userDisplayName: CharSequence?,
    preferDefaultProvider: String?
)
```

Constructs a `https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest.DisplayInfo`.

| Parameters |
|---|---|
| `userId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` | the user id of the created credential |
| `userDisplayName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html?` | an optional display name in addition to the `https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest.DisplayInfo#(kotlin.CharSequence,kotlin.CharSequence,kotlin.String)` that may be displayed next to the `userId` during the user consent to help your user better understand the credential being created |
| `preferDefaultProvider: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | the preferred default provider component name to prioritize in the selection UI flows. Your app must have the permission android.permission.CREDENTIAL_MANAGER_SET_ALLOWED_PROVIDERS to specify this, or it would not take effect. Also this bit may not take effect for Android API level 33 and below, depending on the pre-34 provider(s) you have chosen. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | If `https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest.DisplayInfo#(kotlin.CharSequence,kotlin.CharSequence,kotlin.String)` is empty |

## Public properties

### userDisplayName

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

```
val userDisplayName: CharSequence?
```

an optional display name in addition to the `https://developer.android.com/reference/kotlin/androidx/credentials/CreateCredentialRequest.DisplayInfo#userId()` that may be displayed next to the `userId` during the user consent to help your user better understand the credential being created

### userId

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

```
val userId: CharSequence
```

the user identifier of the created credential