# ReceivingSessionStateCallback

# ReceivingSessionStateCallback

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/ReceivingSessionStateCallback "View this page in Kotlin")\|Java

<br />

```
@RequiresApi(value = 26) interface ReceivingSessionStateCallback extends SessionStateCallback
```

<br />

*** ** * ** ***

Clients of Sessions should implement`ReceivingSessionStateCallback`to receive notifications of Session state changes when transferring a Session.

Provide your implementation in[Sessions.getReceivingSession](https://developer.android.com/reference/com/google/ambient/crossdevice/sessions/Sessions#getReceivingSession(android.content.Intent,com.google.ambient.crossdevice.sessions.ReceivingSessionStateCallback)).

## Summary

|                                                                                                                                                                                                                                                                                                                                                                      ### Public methods                                                                                                                                                                                                                                                                                                                                                                       ||
|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `abstract void` | [onTransferFailure](https://developer.android.com/reference/com/google/ambient/crossdevice/sessions/ReceivingSessionStateCallback#onTransferFailure(com.google.ambient.crossdevice.sessions.SessionId,com.google.ambient.crossdevice.sessions.SessionException))`(` ` @`[NonNull](https://developer.android.com/reference/androidx/annotation/NonNull)` `[SessionId](https://developer.android.com/reference/com/google/ambient/crossdevice/sessions/SessionId)` sessionId,` ` @`[NonNull](https://developer.android.com/reference/androidx/annotation/NonNull)` `[SessionException](https://developer.android.com/reference/com/google/ambient/crossdevice/sessions/SessionException)` exception` `)` Called when transfer cannot complete. |

## Public methods

### onTransferFailure

```
abstract void onTransferFailure(
    @NonNull SessionId sessionId,
    @NonNull SessionException exception
)
```

Called when transfer cannot complete. Failure reason described by`errorCode`