# DeviceLostCallback

Artifact: [androidx.webgpu:webgpu](https://developer.android.com/jetpack/androidx/releases/webgpu) [View Source](https://cs.android.com/search?q=file:androidx/webgpu/DeviceLostCallback.kt+class:androidx.webgpu.DeviceLostCallback) Added in [1.0.0-alpha06](https://developer.android.com/jetpack/androidx/releases/webgpu#1.0.0-alpha06)

*** ** * ** ***


```
fun interface DeviceLostCallback
```

<br />

*** ** * ** ***

## Summary

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/webgpu/DeviceLostCallback#onDeviceLost(androidx.webgpu.GPUDevice,kotlin.Int,kotlin.String)(device: https://developer.android.com/reference/kotlin/androidx/webgpu/GPUDevice, reason: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, message: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` A callback function for handling device loss events. |

## Public functions

### onDeviceLost

Added in [1.0.0-alpha06](https://developer.android.com/jetpack/androidx/releases/webgpu#1.0.0-alpha06)

```
fun onDeviceLost(device: GPUDevice, reason: Int, message: String): Unit
```

A callback function for handling device loss events.

| Parameters |
|---|---|
| `device: https://developer.android.com/reference/kotlin/androidx/webgpu/GPUDevice` | A pointer to the device that was lost. |
| `reason: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The reason for the device loss. Value is one of the following: - `1` - `2` - `3` - `4` <br /> |
| `message: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | An optional message providing more details on the device loss. |