Added in API level 3

InputMethodService.InputMethodSessionImpl


public class InputMethodService.InputMethodSessionImpl
extends AbstractInputMethodService.AbstractInputMethodSessionImpl

java.lang.Object
   ↳ android.inputmethodservice.AbstractInputMethodService.AbstractInputMethodSessionImpl
     ↳ android.inputmethodservice.InputMethodService.InputMethodSessionImpl


Concrete implementation of AbstractInputMethodService.AbstractInputMethodSessionImpl that provides all of the standard behavior for an input method session.

Summary

Public constructors

InputMethodSessionImpl()

Public methods

void appPrivateCommand(String action, Bundle data)

Call InputMethodService.onAppPrivateCommand().

void displayCompletions(CompletionInfo[] completions)

Call InputMethodService.onDisplayCompletions().

void finishInput()
void toggleSoftInput(int showFlags, int hideFlags)

This method is deprecated. Starting in Build.VERSION_CODES.S the system no longer invokes this method, instead it explicitly shows or hides the IME. An InputMethodService wishing to toggle its own visibility should instead invoke InputMethodService.requestShowSelf(int) or InputMethodService.requestHideSelf

void updateCursor(Rect newCursor)

Call InputMethodService.onUpdateCursor().

void updateCursorAnchorInfo(CursorAnchorInfo info)

Call InputMethodService.onUpdateCursorAnchorInfo().

void updateExtractedText(int token, ExtractedText text)

Call InputMethodService.onUpdateExtractedText().

void updateSelection(int oldSelStart, int oldSelEnd, int newSelStart, int newSelEnd, int candidatesStart, int candidatesEnd)

Call InputMethodService.onUpdateSelection().

void viewClicked(boolean focusChanged)

Inherited methods

void dispatchGenericMotionEvent(int seq, MotionEvent event, InputMethodSession.EventCallback callback)

Take care of dispatching incoming generic motion events to the appropriate callbacks on the service, and tell the client when this is done.

void dispatchKeyEvent(int seq, KeyEvent event, InputMethodSession.EventCallback callback)

Take care of dispatching incoming key events to the appropriate callbacks on the service, and tell the client when this is done.

void dispatchTrackballEvent(int seq, MotionEvent event, InputMethodSession.EventCallback callback)

Take care of dispatching incoming trackball events to the appropriate callbacks on the service, and tell the client when this is done.

boolean isEnabled()

Check whether this session has been enabled by the system.

boolean isRevoked()

Check whether this session has been revoked by the system.

boolean onShouldVerifyKeyEvent(KeyEvent event)

void revokeSelf()

Revoke the session from the client.

void setEnabled(boolean enabled)

Change the enabled state of the session.

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 timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

abstract void appPrivateCommand(String action, Bundle data)

Process a private command sent from the application to the input method.

abstract void dispatchGenericMotionEvent(int seq, MotionEvent event, InputMethodSession.EventCallback callback)

This method is called when there is a generic motion event.

abstract void dispatchKeyEvent(int seq, KeyEvent event, InputMethodSession.EventCallback callback)

This method is called when a key is pressed.

abstract void dispatchTrackballEvent(int seq, MotionEvent event, InputMethodSession.EventCallback callback)

This method is called when there is a track ball event.

abstract void displayCompletions(CompletionInfo[] completions)

Called by a text editor that performs auto completion, to tell the input method about the completions it has available.

abstract void finishInput()

This method is called when the application would like to stop receiving text input.

abstract void toggleSoftInput(int showFlags, int hideFlags)

This method was deprecated in API level 31. Starting in Build.VERSION_CODES.S the system no longer invokes this method, instead it explicitly shows or hides the IME. An InputMethodService wishing to toggle its own visibility should instead invoke InputMethodService.requestShowSelf(int) or InputMethodService.requestHideSelf

abstract void updateCursor(Rect newCursor)

This method is called when cursor location of the target input field has changed within its window.

abstract void updateCursorAnchorInfo(CursorAnchorInfo cursorAnchorInfo)

This method is called when the cursor and/or the character position relevant to text input is changed on the screen.

abstract void updateExtractedText(int token, ExtractedText text)

Called by a text editor to report its new extracted text when its contents change.

abstract void updateSelection(int oldSelStart, int oldSelEnd, int newSelStart, int newSelEnd, int candidatesStart, int candidatesEnd)

This method is called when the selection or cursor in the current target input field has changed.

abstract void viewClicked(boolean focusChanged)

This method is called when the user tapped a text view.

Public constructors

InputMethodSessionImpl

public InputMethodSessionImpl ()

Public methods

appPrivateCommand

Added in API level 3
public void appPrivateCommand (String action, 
                Bundle data)

Call InputMethodService.onAppPrivateCommand().

Parameters
action String

data Bundle

displayCompletions

Added in API level 3
public void displayCompletions (CompletionInfo[] completions)

Call InputMethodService.onDisplayCompletions().

Parameters
completions CompletionInfo

finishInput

Added in API level 3
public void finishInput ()

toggleSoftInput

Added in API level 3
public void toggleSoftInput (int showFlags, 
                int hideFlags)

This method is deprecated.
Starting in Build.VERSION_CODES.S the system no longer invokes this method, instead it explicitly shows or hides the IME. An InputMethodService wishing to toggle its own visibility should instead invoke InputMethodService.requestShowSelf(int) or InputMethodService.requestHideSelf

Handles a request to toggle the IME visibility.

Parameters
showFlags int: Value is either 0 or a combination of InputMethodManager.SHOW_IMPLICIT, and InputMethodManager.SHOW_FORCED

hideFlags int: Value is either 0 or a combination of InputMethodManager.HIDE_IMPLICIT_ONLY, and InputMethodManager.HIDE_NOT_ALWAYS

updateCursor

Added in API level 3
public void updateCursor (Rect newCursor)

Call InputMethodService.onUpdateCursor().

Parameters
newCursor Rect

updateCursorAnchorInfo

Added in API level 21
public void updateCursorAnchorInfo (CursorAnchorInfo info)

Call InputMethodService.onUpdateCursorAnchorInfo().

Parameters
info CursorAnchorInfo

updateExtractedText

Added in API level 3
public void updateExtractedText (int token, 
                ExtractedText text)

Call InputMethodService.onUpdateExtractedText().

Parameters
token int

text ExtractedText

updateSelection

Added in API level 3
public void updateSelection (int oldSelStart, 
                int oldSelEnd, 
                int newSelStart, 
                int newSelEnd, 
                int candidatesStart, 
                int candidatesEnd)

Call InputMethodService.onUpdateSelection().

Parameters
oldSelStart int

oldSelEnd int

newSelStart int

newSelEnd int

candidatesStart int

candidatesEnd int

viewClicked

Added in API level 14
public void viewClicked (boolean focusChanged)

Parameters
focusChanged boolean