# ReceivingSessionStateCallback

# ReceivingSessionStateCallback

*** ** * ** ***

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

<br />

```
@RequiresApi(value = 26) interface ReceivingSessionStateCallback : 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/kotlin/com/google/ambient/crossdevice/sessions/Sessions#getReceivingSession(android.content.Intent,com.google.ambient.crossdevice.sessions.ReceivingSessionStateCallback)).

## Summary

|                                                                                                                                                                                                                                                                                                                   ### Public functions                                                                                                                                                                                                                                                                                                                    ||
|--------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://developer.android.com/reference/kotlin/kotlin/Unit) | [onTransferFailure](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/ReceivingSessionStateCallback#onTransferFailure(com.google.ambient.crossdevice.sessions.SessionId,com.google.ambient.crossdevice.sessions.SessionException))`(sessionId: `[SessionId](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionId)`, exception: `[SessionException](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionException)`)` Called when transfer cannot complete. |

## Public functions

### onTransferFailure

```
fun onTransferFailure(sessionId: SessionId, exception: SessionException): Unit
```

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