# 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)

*** ** * ** ***


```
public fun interface DeviceLostCallback
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `abstract void` | `https://developer.android.com/reference/androidx/webgpu/DeviceLostCallback#onDeviceLost(androidx.webgpu.GPUDevice,kotlin.Int,kotlin.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/webgpu/GPUDevice device, int reason, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html message)` A callback function for handling device loss events. |

## Public methods

### onDeviceLost

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

```
abstract void onDeviceLost(@NonNull GPUDevice device, int reason, @NonNull String message)
```

A callback function for handling device loss events.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/webgpu/GPUDevice device` | A pointer to the device that was lost. |
| `int reason` | The reason for the device loss. Value is one of the following: - `1` - `2` - `3` - `4` <br /> |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html message` | An optional message providing more details on the device loss. |