Skip to content

Most visited

Recently visited

navigation

ExtractEditText

public class ExtractEditText
extends EditText

java.lang.Object
   ↳ android.view.View
     ↳ android.widget.TextView
       ↳ android.widget.EditText
         ↳ android.inputmethodservice.ExtractEditText


Specialization of EditText for showing and interacting with the extracted text in a full-screen input method.

Summary

Inherited XML attributes

From class android.widget.TextView
From class android.view.View

Inherited constants

From class android.widget.TextView
From class android.view.View

Inherited fields

From class android.view.View

Public constructors

ExtractEditText(Context context)
ExtractEditText(Context context, AttributeSet attrs)
ExtractEditText(Context context, AttributeSet attrs, int defStyleAttr)
ExtractEditText(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)

Public methods

void finishInternalChanges()

Finish making changes that will not be reported to the client.

boolean hasFocus()

Pretend like this view always has focus, so its highlight and cursor will be displayed.

boolean hasVerticalScrollBar()

Return true if the edit text is currently showing a scroll bar.

boolean hasWindowFocus()

Pretend like the window this view is in always has focus, so its highlight and cursor will be displayed.

boolean isFocused()

Pretend like this view always has focus, so its highlight and cursor will be displayed.

boolean isInputMethodTarget()

We are always considered to be an input method target.

boolean onTextContextMenuItem(int id)

Called when a context menu option for the text view is selected.

boolean performClick()

Redirect clicks to the IME for handling there.

void setExtractedText(ExtractedText text)

Implement just to keep track of when we are setting text from the client (vs.

void startInternalChanges()

Start making changes that will not be reported to the client.

Protected methods

void onSelectionChanged(int selStart, int selEnd)

Report to the underlying text editor about selection changes.

Inherited methods

From class android.widget.EditText
From class android.widget.TextView
From class android.view.View
From class java.lang.Object
From interface android.view.ViewTreeObserver.OnPreDrawListener
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.accessibility.AccessibilityEventSource

Public constructors

ExtractEditText

added in API level 3
ExtractEditText (Context context)

Parameters
context Context

ExtractEditText

added in API level 3
ExtractEditText (Context context, 
                AttributeSet attrs)

Parameters
context Context

attrs AttributeSet

ExtractEditText

added in API level 3
ExtractEditText (Context context, 
                AttributeSet attrs, 
                int defStyleAttr)

Parameters
context Context

attrs AttributeSet

defStyleAttr int

ExtractEditText

added in API level 21
ExtractEditText (Context context, 
                AttributeSet attrs, 
                int defStyleAttr, 
                int defStyleRes)

Parameters
context Context

attrs AttributeSet

defStyleAttr int

defStyleRes int

Public methods

finishInternalChanges

added in API level 3
void finishInternalChanges ()

Finish making changes that will not be reported to the client. That is, onSelectionChanged(int, int) will not result in sending the new selection to the client

hasFocus

added in API level 3
boolean hasFocus ()

Pretend like this view always has focus, so its highlight and cursor will be displayed.

Returns
boolean True if this view has or contains focus, false otherwise.

hasVerticalScrollBar

added in API level 3
boolean hasVerticalScrollBar ()

Return true if the edit text is currently showing a scroll bar.

Returns
boolean

hasWindowFocus

added in API level 3
boolean hasWindowFocus ()

Pretend like the window this view is in always has focus, so its highlight and cursor will be displayed.

Returns
boolean True if this view is in a window that currently has window focus.

isFocused

added in API level 3
boolean isFocused ()

Pretend like this view always has focus, so its highlight and cursor will be displayed.

Returns
boolean True if this view has focus, false otherwise.

isInputMethodTarget

added in API level 3
boolean isInputMethodTarget ()

We are always considered to be an input method target.

Returns
boolean True if the TextView is a current input method target; false otherwise.

onTextContextMenuItem

added in API level 3
boolean onTextContextMenuItem (int id)

Called when a context menu option for the text view is selected. Currently this will be one of selectAll, cut, copy, paste or shareText.

Parameters
id int

Returns
boolean true if the context menu item action was performed.

performClick

added in API level 3
boolean performClick ()

Redirect clicks to the IME for handling there. First allows any on click handler to run, though.

Returns
boolean True there was an assigned OnClickListener that was called, false otherwise is returned.

setExtractedText

added in API level 3
void setExtractedText (ExtractedText text)

Implement just to keep track of when we are setting text from the client (vs. seeing changes in ourself from the user).

Parameters
text ExtractedText

startInternalChanges

added in API level 3
void startInternalChanges ()

Start making changes that will not be reported to the client. That is, onSelectionChanged(int, int) will not result in sending the new selection to the client

Protected methods

onSelectionChanged

added in API level 3
void onSelectionChanged (int selStart, 
                int selEnd)

Report to the underlying text editor about selection changes.

Parameters
selStart int: The new selection start location.

selEnd int: The new selection end location.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)