# PrepareGetCredentialResponse

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Nested Classes](https://developer.android.com/reference/android/credentials/PrepareGetCredentialResponse#nestedclasses)\|[Methods](https://developer.android.com/reference/android/credentials/PrepareGetCredentialResponse#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/credentials/PrepareGetCredentialResponse#inhmethods)  

# PrepareGetCredentialResponse

*** ** * ** ***

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

`
public

final

class
PrepareGetCredentialResponse
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|--------------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.credentials.PrepareGetCredentialResponse |

<br />

*** ** * ** ***

A response object that prefetches user app credentials and provides metadata about them. It can then be used to issue the full credential retrieval flow via the[CredentialManager.getCredential(Context, PendingGetCredentialHandle, CancellationSignal,
Executor, OutcomeReceiver)](https://developer.android.com/reference/android/credentials/CredentialManager#getCredential(android.content.Context,%20android.credentials.PrepareGetCredentialResponse.PendingGetCredentialHandle,%20android.os.CancellationSignal,%20java.util.concurrent.Executor,%20android.os.OutcomeReceiver<android.credentials.GetCredentialResponse,android.credentials.GetCredentialException>))method to perform the remaining flows such as consent collection and credential selection, to officially retrieve a credential.

## Summary

|                                                                                                                  ### Nested classes                                                                                                                   ||
|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` class` | [PrepareGetCredentialResponse.PendingGetCredentialHandle](https://developer.android.com/reference/android/credentials/PrepareGetCredentialResponse.PendingGetCredentialHandle) A handle that represents a pending get-credential operation. |

|                                                                                                                                                                                                                                                                ### Public methods                                                                                                                                                                                                                                                                ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[PrepareGetCredentialResponse.PendingGetCredentialHandle](https://developer.android.com/reference/android/credentials/PrepareGetCredentialResponse.PendingGetCredentialHandle) | ` `[getPendingGetCredentialHandle](https://developer.android.com/reference/android/credentials/PrepareGetCredentialResponse#getPendingGetCredentialHandle())`() ` Returns a handle that represents this pending get-credential operation.                                                                                                                     |
| ` boolean`                                                                                                                                                                        | ` `[hasAuthenticationResults](https://developer.android.com/reference/android/credentials/PrepareGetCredentialResponse#hasAuthenticationResults())`() ` Returns true if the user has any candidate authentication actions (locked credential supplier), and false otherwise.                                                                                  |
| ` boolean`                                                                                                                                                                        | ` `[hasCredentialResults](https://developer.android.com/reference/android/credentials/PrepareGetCredentialResponse#hasCredentialResults(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` credentialType) ` Returns true if the user has any candidate credentials for the given`credentialType`, and false otherwise. |
| ` boolean`                                                                                                                                                                        | ` `[hasRemoteResults](https://developer.android.com/reference/android/credentials/PrepareGetCredentialResponse#hasRemoteResults())`() ` Returns true if the user has any candidate remote credential results, and false otherwise.                                                                                                                            |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Public methods

### getPendingGetCredentialHandle

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public PrepareGetCredentialResponse.PendingGetCredentialHandle getPendingGetCredentialHandle ()
```

Returns a handle that represents this pending get-credential operation. Pass this handle to[CredentialManager.getCredential(Context, PendingGetCredentialHandle,
CancellationSignal, Executor, OutcomeReceiver)](https://developer.android.com/reference/android/credentials/CredentialManager#getCredential(android.content.Context,%20android.credentials.PrepareGetCredentialResponse.PendingGetCredentialHandle,%20android.os.CancellationSignal,%20java.util.concurrent.Executor,%20android.os.OutcomeReceiver<android.credentials.GetCredentialResponse,android.credentials.GetCredentialException>))to perform the remaining flows to officially retrieve a credential.

<br />

|                                                                                                      Returns                                                                                                       ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| [PrepareGetCredentialResponse.PendingGetCredentialHandle](https://developer.android.com/reference/android/credentials/PrepareGetCredentialResponse.PendingGetCredentialHandle) | This value cannot be`null`. <br /> |

### hasAuthenticationResults

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean hasAuthenticationResults ()
```

Returns true if the user has any candidate authentication actions (locked credential supplier), and false otherwise.  
Requires[Manifest.permission.CREDENTIAL_MANAGER_QUERY_CANDIDATE_CREDENTIALS](https://developer.android.com/reference/android/Manifest.permission#CREDENTIAL_MANAGER_QUERY_CANDIDATE_CREDENTIALS)

<br />

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### hasCredentialResults

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean hasCredentialResults (String credentialType)
```

Returns true if the user has any candidate credentials for the given`credentialType`, and false otherwise.  
Requires[Manifest.permission.CREDENTIAL_MANAGER_QUERY_CANDIDATE_CREDENTIALS](https://developer.android.com/reference/android/Manifest.permission#CREDENTIAL_MANAGER_QUERY_CANDIDATE_CREDENTIALS)

<br />

|                           Parameters                           ||
|------------------|----------------------------------------------|
| `credentialType` | `String`: This value cannot be`null`. <br /> |

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### hasRemoteResults

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean hasRemoteResults ()
```

Returns true if the user has any candidate remote credential results, and false otherwise.  
Requires[Manifest.permission.CREDENTIAL_MANAGER_QUERY_CANDIDATE_CREDENTIALS](https://developer.android.com/reference/android/Manifest.permission#CREDENTIAL_MANAGER_QUERY_CANDIDATE_CREDENTIALS)

<br />

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |