# CredentialManagerCallback

# CredentialManagerCallback

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

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/credentials/CredentialManagerCallback "View this page in Java")

<br />

```
interface CredentialManagerCallback<R : Any?, E : Any>
```

<br />

*** ** * ** ***

Callback interface intended for use when an asynchronous Credential Manager operation may result in a failure.

This interface may be used in cases where an asynchronous Credential Manager API may complete either with a value, or an exception.  

|                                       Parameters                                       |
|----------------------------------------------------------------------------------------|------------------------------------------|
| `<R : `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?>` | the type of the result that's being sent |
| `<E : `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`>`  | the type of the exception being returned |

## Summary

|                             ### Public functions                              |
|-------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onError](https://developer.android.com/reference/kotlin/androidx/credentials/CredentialManagerCallback#onError(kotlin.Any))`(e: E)`        |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onResult](https://developer.android.com/reference/kotlin/androidx/credentials/CredentialManagerCallback#onResult(kotlin.Any))`(result: R)` |

## Public functions

### onError

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

```
fun onError(e: E): Unit
```  

### onResult

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

```
fun onResult(result: R): Unit
```