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

```kotlin
public class MutableRemoteLong
internal constructor(
    @get:Suppress("AutoBoxing") public override val constantValueOrNull: Long?,
    internal override val cacheKey: RemoteStateCacheKey,
    private val idProvider: (creationState: RemoteComposeCreationState) -> Int,
) : RemoteLong(), MutableRemoteState<Long>
```

A mutable implementation of [RemoteLong](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteLong).

#### Parameters

| | |
| --- | --- |
| constantValueOrNull | A nullable value if this [MutableRemoteLong](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/MutableRemoteLong) is constant. |

## Secondary Constructors

```kotlin
internal constructor(
    id: Int
) : this(constantValueOrNull = null, cacheKey = RemoteStateIdKey(id), { id })
```

Constructor for [MutableRemoteLong](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/MutableRemoteLong) that allows specifying an optional initial ID. If no ID
is provided, a new float variable ID is reserved.

#### Parameters

| | |
| --- | --- |
| id | An optional explicit ID for this mutable long. If `null`, a new ID is reserved. |

## Companion Object

#### Methods

<h2 id="createmutable-initialvalue">createMutable</h2>

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

```kotlin
public fun createMutable(initialValue: Long): MutableRemoteLong
```

Creates a new mutable state (allocates an ID).

#### Parameters

| | |
| --- | --- |
| initialValue | The initial value for the state. |

#### Returns

| | |
| --- | --- |
|  | A new [MutableRemoteLong](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/MutableRemoteLong) instance. |