# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Fields | Methods | Inherited Methods

# Selection

`public class Selection`
`extends Object` ``

java.lang.Object
↳ | android.text.Selection

Utility class for manipulating cursors and selections in CharSequences. A cursor is a selection where the start and end are at the same offset.

## Summary

### Fields
`public static final Object` | `SELECTION_END`
`public static final Object` | `SELECTION_START`

### Public methods
`static boolean` | `extendDown(Spannable text, Layout layout)` Move the selection end to the buffer offset physically below the current selection end.
`static boolean` | `extendLeft(Spannable text, Layout layout)` Move the selection end to the buffer offset physically to the left of the current selection end.
`static boolean` | `extendRight(Spannable text, Layout layout)` Move the selection end to the buffer offset physically to the right of the current selection end.
`static final void` | `extendSelection(Spannable text, int index)` Move the selection edge to offset `index`.
`static boolean` | `extendToLeftEdge(Spannable text, Layout layout)`
`static boolean` | `extendToRightEdge(Spannable text, Layout layout)`
`static boolean` | `extendUp(Spannable text, Layout layout)` Move the selection end to the buffer offset physically above the current selection end.
`static final int` | `getSelectionEnd(CharSequence text)` Return the offset of the selection edge or cursor, or -1 if there is no selection or cursor.
`static final int` | `getSelectionStart(CharSequence text)` Return the offset of the selection anchor or cursor, or -1 if there is no selection or cursor.
`static boolean` | `moveDown(Spannable text, Layout layout)` Move the cursor to the buffer offset physically below the current offset, to the end of the buffer if it is on the bottom line but not at the end, or return false if the cursor is already at the end of the buffer.
`static boolean` | `moveLeft(Spannable text, Layout layout)` Move the cursor to the buffer offset physically to the left of the current offset, or return false if the cursor is already at the left edge of the line and there is not another line to move it to.
`static boolean` | `moveRight(Spannable text, Layout layout)` Move the cursor to the buffer offset physically to the right of the current offset, or return false if the cursor is already at at the right edge of the line and there is not another line to move it to.
`static boolean` | `moveToLeftEdge(Spannable text, Layout layout)`
`static boolean` | `moveToRightEdge(Spannable text, Layout layout)`
`static boolean` | `moveUp(Spannable text, Layout layout)` Move the cursor to the buffer offset physically above the current offset, to the beginning if it is on the top line but not at the start, or return false if the cursor is already on the top line.
`static final void` | `removeSelection(Spannable text)` Remove the selection or cursor, if any, from the text.
`static final void` | `selectAll(Spannable text)` Select the entire text.
`static void` | `setSelection(Spannable text, int start, int stop)` Set the selection anchor to `start` and the selection edge to `stop`.
`static final void` | `setSelection(Spannable text, int index)` Move the cursor to offset `index`.

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.

## Fields

### SELECTION_END

    public static final Object SELECTION_END

### SELECTION_START

    public static final Object SELECTION_START

## Public methods

### extendDown

    public static boolean extendDown (Spannable text,
                    Layout layout)

Move the selection end to the buffer offset physically below the current selection end.

Parameters
`text` | `Spannable`
`layout` | `Layout`

Returns
`boolean` |

### extendLeft

    public static boolean extendLeft (Spannable text,
                    Layout layout)

Move the selection end to the buffer offset physically to the left of the current selection end.

Parameters
`text` | `Spannable`
`layout` | `Layout`

Returns
`boolean` |

### extendRight

    public static boolean extendRight (Spannable text,
                    Layout layout)

Move the selection end to the buffer offset physically to the right of the current selection end.

Parameters
`text` | `Spannable`
`layout` | `Layout`

Returns
`boolean` |

### extendSelection

    public static final void extendSelection (Spannable text,
                    int index)

Move the selection edge to offset `index`.

Parameters
`text` | `Spannable`
`index` | `int`

### extendToLeftEdge

    public static boolean extendToLeftEdge (Spannable text,
                    Layout layout)

Parameters
`text` | `Spannable`
`layout` | `Layout`

Returns
`boolean` |

### extendToRightEdge

    public static boolean extendToRightEdge (Spannable text,
                    Layout layout)

Parameters
`text` | `Spannable`
`layout` | `Layout`

Returns
`boolean` |

### extendUp

    public static boolean extendUp (Spannable text,
                    Layout layout)

Move the selection end to the buffer offset physically above the current selection end.

Parameters
`text` | `Spannable`
`layout` | `Layout`

Returns
`boolean` |

### getSelectionEnd

    public static final int getSelectionEnd (CharSequence text)

Return the offset of the selection edge or cursor, or -1 if there is no selection or cursor.

Parameters
`text` | `CharSequence`

Returns
`int` |

### getSelectionStart

    public static final int getSelectionStart (CharSequence text)

Return the offset of the selection anchor or cursor, or -1 if there is no selection or cursor.

Parameters
`text` | `CharSequence`

Returns
`int` |

### moveDown

    public static boolean moveDown (Spannable text,
                    Layout layout)

Move the cursor to the buffer offset physically below the current offset, to the end of the buffer if it is on the bottom line but not at the end, or return false if the cursor is already at the end of the buffer.

Parameters
`text` | `Spannable`
`layout` | `Layout`

Returns
`boolean` |

### moveLeft

    public static boolean moveLeft (Spannable text,
                    Layout layout)

Move the cursor to the buffer offset physically to the left of the current offset, or return false if the cursor is already at the left edge of the line and there is not another line to move it to.

Parameters
`text` | `Spannable`
`layout` | `Layout`

Returns
`boolean` |

### moveRight

    public static boolean moveRight (Spannable text,
                    Layout layout)

Move the cursor to the buffer offset physically to the right of the current offset, or return false if the cursor is already at at the right edge of the line and there is not another line to move it to.

Parameters
`text` | `Spannable`
`layout` | `Layout`

Returns
`boolean` |

### moveToLeftEdge

    public static boolean moveToLeftEdge (Spannable text,
                    Layout layout)

Parameters
`text` | `Spannable`
`layout` | `Layout`

Returns
`boolean` |

### moveToRightEdge

    public static boolean moveToRightEdge (Spannable text,
                    Layout layout)

Parameters
`text` | `Spannable`
`layout` | `Layout`

Returns
`boolean` |

### moveUp

    public static boolean moveUp (Spannable text,
                    Layout layout)

Move the cursor to the buffer offset physically above the current offset, to the beginning if it is on the top line but not at the start, or return false if the cursor is already on the top line.

Parameters
`text` | `Spannable`
`layout` | `Layout`

Returns
`boolean` |

### removeSelection

    public static final void removeSelection (Spannable text)

Remove the selection or cursor, if any, from the text.

Parameters
`text` | `Spannable`

### selectAll

    public static final void selectAll (Spannable text)

Select the entire text.

Parameters
`text` | `Spannable`

### setSelection

    public static void setSelection (Spannable text,
                    int start,
                    int stop)

Set the selection anchor to `start` and the selection edge to `stop`.

Parameters
`text` | `Spannable`
`start` | `int`
`stop` | `int`

### setSelection

    public static final void setSelection (Spannable text,
                    int index)

Move the cursor to offset `index`.

Parameters
`text` | `Spannable`
`index` | `int`

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*