# CancelledKeyException

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

# CancelledKeyException

```
open class CancelledKeyException : IllegalStateException
```

|---|---|---|---|---|------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                 ||||||
| ↳ | [kotlin.Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)                                                  |||||
|   | ↳ | [java.lang.Exception](https://developer.android.com/reference/kotlin/java/lang/Exception.html#)                                             ||||
|   |   | ↳ | [java.lang.RuntimeException](https://developer.android.com/reference/kotlin/java/lang/RuntimeException.html#)                            |||
|   |   |   | ↳ | [java.lang.IllegalStateException](https://developer.android.com/reference/kotlin/java/lang/IllegalStateException.html#)               ||
|   |   |   |   | ↳ | [java.nio.channels.CancelledKeyException](https://developer.android.com/reference/kotlin/java/nio/channels/CancelledKeyException#) |

Unchecked exception thrown when an attempt is made to use a selection key that is no longer valid.

## Summary

|                                                                                 Public constructors                                                                                  ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [CancelledKeyException](https://developer.android.com/reference/kotlin/java/nio/channels/CancelledKeyException#CancelledKeyException())`()` Constructs an instance of this class. |

## Public constructors

### CancelledKeyException

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

```
CancelledKeyException()
```

Constructs an instance of this class.