Stay organized with collections
Save and categorize content based on your preferences.
LinkMovementMethod
open class LinkMovementMethod : ScrollingMovementMethod
A movement method that traverses links in the text buffer and scrolls if necessary. Supports clicking on links with DPad Center or Enter.
Summary
| Public methods |
| open Boolean |
Returns true if this movement method allows arbitrary selection of any text; false if it has no selection (like a movement method that only scrolls) or a constrained selection (for example limited to links. The "Select All" menu item is disabled if arbitrary selection is not allowed.
|
| open static MovementMethod! |
|
| open Unit |
|
| open Unit |
|
| open Boolean |
|
| Protected methods |
| open Boolean |
Performs a down movement action.
|
| open Boolean |
Performs a movement key action.
|
| open Boolean |
Performs a left movement action.
|
| open Boolean |
Performs a right movement action.
|
| open Boolean |
Performs an up movement action.
|
| Inherited functions |
From class ScrollingMovementMethod
Boolean |
bottom(widget: TextView!, buffer: Spannable!)
Performs a bottom movement action. Moves the cursor or scrolls to the bottom of the buffer.
|
Boolean |
end(widget: TextView!, buffer: Spannable!)
Performs an end movement action. Moves the cursor or scrolls to the start of the line or to the top of the document depending on whether the insertion point is being moved or the document is being scrolled.
|
Boolean |
home(widget: TextView!, buffer: Spannable!)
Performs a home movement action. Moves the cursor or scrolls to the start of the line or to the top of the document depending on whether the insertion point is being moved or the document is being scrolled.
|
Boolean |
lineEnd(widget: TextView!, buffer: Spannable!)
Performs a line-end movement action. Moves the cursor or scrolls to the end of the line.
|
Boolean |
lineStart(widget: TextView!, buffer: Spannable!)
Performs a line-start movement action. Moves the cursor or scrolls to the start of the line.
|
Boolean |
pageDown(widget: TextView!, buffer: Spannable!)
Performs a page-down movement action. Moves the cursor or scrolls down by one page.
|
Boolean |
pageUp(widget: TextView!, buffer: Spannable!)
Performs a page-up movement action. Moves the cursor or scrolls up by one page.
|
Boolean |
top(widget: TextView!, buffer: Spannable!)
Performs a top movement action. Moves the cursor or scrolls to the top of the buffer.
|
|
From class BaseMovementMethod
Boolean |
canSelectArbitrarily()
Returns true if this movement method allows arbitrary selection of any text; false if it has no selection (like a movement method that only scrolls) or a constrained selection (for example limited to links. The "Select All" menu item is disabled if arbitrary selection is not allowed.
|
Int |
getMovementMetaState(buffer: Spannable!, event: KeyEvent!)
Gets the meta state used for movement using the modifiers tracked by the text buffer as well as those present in the key event. The movement meta state excludes the state of locked modifiers or the SHIFT key since they are not used by movement actions (but they may be used for selection).
|
Boolean |
handleMovementKey(widget: TextView!, buffer: Spannable!, keyCode: Int, movementMetaState: Int, event: KeyEvent!)
Performs a movement key action. The default implementation decodes the key down and invokes movement actions such as down and up. onKeyDown(android.widget.TextView,android.text.Spannable,int,android.view.KeyEvent) calls this method once to handle an KeyEvent.ACTION_DOWN. onKeyOther(android.widget.TextView,android.text.Spannable,android.view.KeyEvent) calls this method repeatedly to handle each repetition of an KeyEvent.ACTION_MULTIPLE.
|
Unit |
initialize(widget: TextView!, text: Spannable!)
|
Boolean |
nextParagraph(widget: TextView, buffer: Spannable)
Performs a next paragraph movement action.
|
Boolean |
onGenericMotionEvent(widget: TextView!, text: Spannable!, event: MotionEvent!)
|
Boolean |
onKeyDown(widget: TextView!, text: Spannable!, keyCode: Int, event: KeyEvent!)
|
Boolean |
onKeyOther(widget: TextView!, text: Spannable!, event: KeyEvent!)
If the key listener wants to other kinds of key events, return true, otherwise return false and the caller (i.e. the widget host) will handle the key.
|
Boolean |
onKeyUp(widget: TextView!, text: Spannable!, keyCode: Int, event: KeyEvent!)
|
Boolean |
onTrackballEvent(widget: TextView!, text: Spannable!, event: MotionEvent!)
|
Boolean |
previousParagraph(widget: TextView, buffer: Spannable)
Performs a previous paragraph movement action.
|
|
Public constructors
LinkMovementMethod
LinkMovementMethod()
Public methods
canSelectArbitrarily
open fun canSelectArbitrarily(): Boolean
Returns true if this movement method allows arbitrary selection of any text; false if it has no selection (like a movement method that only scrolls) or a constrained selection (for example limited to links. The "Select All" menu item is disabled if arbitrary selection is not allowed.
Protected methods
down
protected open fun down(
widget: TextView!,
buffer: Spannable!
): Boolean
Performs a down movement action. Moves the cursor or scrolls down by one line.
| Return |
Boolean |
True if the event was handled. |
left
protected open fun left(
widget: TextView!,
buffer: Spannable!
): Boolean
Performs a left movement action. Moves the cursor or scrolls left by one character.
| Return |
Boolean |
True if the event was handled. |
right
protected open fun right(
widget: TextView!,
buffer: Spannable!
): Boolean
Performs a right movement action. Moves the cursor or scrolls right by one character.
| Return |
Boolean |
True if the event was handled. |
up
protected open fun up(
widget: TextView!,
buffer: Spannable!
): Boolean
Performs an up movement action. Moves the cursor or scrolls up by one line.
| Return |
Boolean |
True if the event was handled. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2026-02-13 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-02-13 UTC."],[],[]]