Added in API level 3

AbstractInputMethodImpl


abstract class AbstractInputMethodImpl : InputMethod
InputMethodService.InputMethodImpl

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

Base class for derived classes to implement their InputMethod interface. This takes care of basic maintenance of the input method, but most behavior must be implemented in a derived class.

Summary

Inherited constants
String SERVICE_INTERFACE

This is the interface name that a service implementing an input method should say that it supports -- that is, this is the action it uses for its intent filter. To be supported, the service must also require the android.Manifest.permission#BIND_INPUT_METHOD permission so that other applications can not abuse it.

String SERVICE_META_DATA

Name under which an InputMethod service component publishes information about itself. This meta-data must reference an XML resource containing an <input-method> tag.

Int SHOW_EXPLICIT

Flag for showSoftInput: this show has been explicitly requested by the user. If not set, the system has decided it may be a good idea to show the input method based on a navigation operation in the UI.

Int SHOW_FORCED

Flag for showSoftInput: this show has been forced to happen by the user. If set, the input method should remain visible until deliberated dismissed by the user in its UI.

Public constructors

Public methods
open Unit

Instantiate a new client session for the input method, by calling back to AbstractInputMethodService.onCreateInputMethodSessionInterface().

open Unit

Take care of killing an existing session by calling its AbstractInputMethodSessionImpl.revokeSelf() method.

open Unit

Take care of enabling or disabling an existing session by calling its AbstractInputMethodSessionImpl.setEnabled() method.

Inherited functions
Unit attachToken(token: IBinder!)

Called first thing after an input method is created, this supplies a unique token for the session it has with the system service. It is needed to identify itself with the service to validate its operations. This token must not be passed to applications, since it grants special priviledges that should not be given to applications.

The system guarantees that this method is called back between InputMethodService.onCreate() and android.inputmethodservice.InputMethodService#onDestroy() at most once.
This method must be called from the main thread of your app.

Unit bindInput(binding: InputBinding!)

Bind a new application environment in to the input method, so that it can later start and stop input processing. Typically this method is called when this input method is enabled in an application for the first time.
This method must be called from the main thread of your app.

Unit changeInputMethodSubtype(subtype: InputMethodSubtype!)

Notify that the input method subtype is being changed in the same input method.
This method must be called from the main thread of your app.

Unit hideSoftInput(flags: Int, resultReceiver: ResultReceiver!)

Request that any soft input part of the input method be hidden from the user.
This method must be called from the main thread of your app.

Unit restartInput(inputConnection: InputConnection!, editorInfo: EditorInfo!)

This method is called when the state of this input method needs to be reset.

Typically, this method is called when the input focus is moved from one text box to another.
This method must be called from the main thread of your app.

Unit showSoftInput(flags: Int, resultReceiver: ResultReceiver!)

Request that any soft input part of the input method be shown to the user.
This method must be called from the main thread of your app.

Unit startInput(inputConnection: InputConnection!, editorInfo: EditorInfo!)

This method is called when the application starts to receive text and it is ready for this input method to process received events and send result text back to the application.
This method must be called from the main thread of your app.

Unit unbindInput()

Unbind an application environment, called when the information previously set by bindInput is no longer valid for this input method.

Typically this method is called when the application changes to be non-foreground.
This method must be called from the main thread of your app.

Public constructors

AbstractInputMethodImpl

AbstractInputMethodImpl()

Public methods

createSession

Added in API level 3
open fun createSession(callback: InputMethod.SessionCallback!): Unit

Instantiate a new client session for the input method, by calling back to AbstractInputMethodService.onCreateInputMethodSessionInterface().
This method must be called from the main thread of your app.

Parameters
callback InputMethod.SessionCallback!: Interface that is called with the newly created session.

revokeSession

Added in API level 3
open fun revokeSession(session: InputMethodSession!): Unit

Take care of killing an existing session by calling its AbstractInputMethodSessionImpl.revokeSelf() method.
This method must be called from the main thread of your app.

Parameters
session InputMethodSession!: The InputMethodSession previously provided through SessionCallback.sessionCreated() that is to be revoked.

setSessionEnabled

Added in API level 3
open fun setSessionEnabled(
    session: InputMethodSession!,
    enabled: Boolean
): Unit

Take care of enabling or disabling an existing session by calling its AbstractInputMethodSessionImpl.setEnabled() method.
This method must be called from the main thread of your app.

Parameters
session InputMethodSession!: The InputMethodSession previously provided through SessionCallback.sessionCreated() that is to be changed.