<div class='sourceset sourceset-android'>Android</div>

```kotlin
public interface OnAttachStateChangeListener
```

Interface definition for callbacks that are invoked when this element's attachment state
changes.

## Functions

<h2 id="onelementattachedtosubspace-spatialcomposescene">onElementAttachedToSubspace</h2>

```kotlin
public fun onElementAttachedToSubspace(spatialComposeScene: SpatialComposeScene)
```

Called when the `SpatialElement` is attached to a `SpatialComposeScene`.

#### Parameters

| | |
| --- | --- |
| spatialComposeScene | The `SpatialComposeScene` that the element was attached to. |

<hr class="docs-overload-divider">

<h2 id="onelementdetachedfromsubspace-spatialcomposescene">onElementDetachedFromSubspace</h2>

```kotlin
public fun onElementDetachedFromSubspace(spatialComposeScene: SpatialComposeScene)
```

Called when the `SpatialElement` is detached from a `SpatialComposeScene`.

#### Parameters

| | |
| --- | --- |
| spatialComposeScene | The `SpatialComposeScene` that the element was detached from. |