---
title: "SetSelectionCommand"
description: "Sets the selection on the text. When [start] and [end] have the same value, it sets the cursor
position.

See
[`setSelection`](https://developer.android.com/reference/android/view/inputmethod/InputConnection.html#setSelection(int,%2520int))."
type: "class"
---

<div class='type'>Class</div>


<a id='references'></a>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
class SetSelectionCommand(val start: Int, val end: Int) : EditCommand
```


Sets the selection on the text. When `start` and `end` have the same value, it sets the cursor
position.

See
``setSelection``(https://developer.android.com/reference/android/view/inputmethod/InputConnection.html#setSelection(int,%2520int)).

#### Parameters

| | |
| --- | --- |
| start | The inclusive start offset of the selection region. |
| end | The exclusive end offset of the selection region. |




