Selection - JRE Emulation | JRE Emulation
public class

Selection

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

Class Overview

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
final static void extendSelection(Spannable text, int index)
Move the selection edge to offset index.
final static int getSelectionEnd(CharSequence text)
Return the offset of the selection edge or cursor, or -1 if there is no selection or cursor.
final static int getSelectionStart(CharSequence text)
Return the offset of the selection anchor or cursor, or -1 if there is no selection or cursor.
final static void removeSelection(Spannable text)
Remove the selection or cursor, if any, from the text.
final static 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.
final static void setSelection(Spannable text, int index)
Move the cursor to offset index.
Inherited Methods
[Expand]
From class java.lang.Object

Fields

public static final Object SELECTION_END

public static final Object SELECTION_START

Public Methods

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

Move the selection edge to offset index.

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.

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.

public static final void removeSelection (Spannable text)

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

public static final void selectAll (Spannable text)

Select the entire text.

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

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

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

Move the cursor to offset index.