Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# RSMessageHandler

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/android/renderscript/RenderScript.RSMessageHandler "View this page in Java")

```
open class RSMessageHandler : Runnable
```

|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||
| ↳ | [android.renderscript.RenderScript.RSMessageHandler](https://developer.android.com/reference/kotlin/android/renderscript/RenderScript.RSMessageHandler#) |

*** ** * ** ***

| **This class was deprecated in API level 31.**
|
| Deprecated in Java.

The base class from which an application should derive in order to receive RS messages from scripts. When a script calls `rsSendToClient`, the data fields will be filled, and the run method will be called on a separate thread. This will occur some time after `rsSendToClient` completes in the script, as `rsSendToClient` is asynchronous. Message handlers are not guaranteed to have completed when `https://developer.android.com/reference/kotlin/android/renderscript/RenderScript#finish()` returns.

## Summary

| Public constructors ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/renderscript/RenderScript.RSMessageHandler#RSMessageHandler()()` <br /> |

| Public methods ||
|---|---|
| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/renderscript/RenderScript.RSMessageHandler#run()()` When an object implementing interface `Runnable` is used to create a thread, starting the thread causes the object's `run` method to be called in that separately executing thread. |

| Properties ||
|---|---|
| [IntArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int-array/index.html)! | `https://developer.android.com/reference/kotlin/android/renderscript/RenderScript.RSMessageHandler#mData:kotlin.IntArray` <br /> |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/renderscript/RenderScript.RSMessageHandler#mID:kotlin.Int` <br /> |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/renderscript/RenderScript.RSMessageHandler#mLength:kotlin.Int` <br /> |

## Public constructors

### RSMessageHandler

```
RSMessageHandler()
```

## Public methods

### run

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
open fun run(): Unit
```

**Deprecated:** *Deprecated in Java.*

When an object implementing interface `Runnable` is used to create a thread, starting the thread causes the object's `run` method to be called in that separately executing thread.

The general contract of the method `run` is that it may take any action whatsoever.

## Properties

### mData

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
protected var mData: IntArray!
```

**Deprecated:** *Deprecated in Java.*

### mID

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
protected var mID: Int
```

**Deprecated:** *Deprecated in Java.*

### mLength

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
protected var mLength: Int
```

**Deprecated:** *Deprecated in Java.*