Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Inherited Constants](https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService.AbstractInputMethodImpl#inhconstants) \| [Ctors](https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService.AbstractInputMethodImpl#pubctors) \| [Methods](https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService.AbstractInputMethodImpl#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService.AbstractInputMethodImpl#inhmethods)

# AbstractInputMethodService.AbstractInputMethodImpl

*** ** * ** ***


`
public


abstract
class
AbstractInputMethodService.AbstractInputMethodImpl
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


implements

https://developer.android.com/reference/android/view/inputmethod/InputMethod


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.inputmethodservice.AbstractInputMethodService.AbstractInputMethodImpl |

Known direct subclasses [InputMethodService.InputMethodImpl](https://developer.android.com/reference/android/inputmethodservice/InputMethodService.InputMethodImpl) [InputMethodService.InputMethodImpl](https://developer.android.com/reference/android/inputmethodservice/InputMethodService.InputMethodImpl) Concrete implementation of `https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService.AbstractInputMethodImpl` that provides all of the standard behavior for an input method.   

*** ** * ** ***

Base class for derived classes to implement their `https://developer.android.com/reference/android/view/inputmethod/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

From interface `https://developer.android.com/reference/android/view/inputmethod/InputMethod` `https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/view/inputmethod/InputMethod#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.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/view/inputmethod/InputMethod#SERVICE_META_DATA`

Name under which an InputMethod service component publishes information
about itself.


`int` `https://developer.android.com/reference/android/view/inputmethod/InputMethod#SHOW_EXPLICIT`

*This constant was deprecated
in API level 37.
`https://developer.android.com/reference/android/view/inputmethod/InputMethodManager#SHOW_IMPLICIT` is deprecated therefore this flag
becomes the default. There is no need to pass it anymore.*


`int` `https://developer.android.com/reference/android/view/inputmethod/InputMethod#SHOW_FORCED`

*This constant was deprecated
in API level 35.
Starting in `https://developer.android.com/reference/android/os/Build.VERSION_CODES#BAKLAVA`,
`https://developer.android.com/reference/android/view/inputmethod/InputMethodManager#SHOW_IMPLICIT` is deprecated and has no effect, therefore all
requests will have this flag set. IMEs should no longer react to this flag.*


| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService.AbstractInputMethodImpl#AbstractInputMethodImpl()() ` |

| ### Public methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService.AbstractInputMethodImpl#createSession(android.view.inputmethod.InputMethod.SessionCallback)(https://developer.android.com/reference/android/view/inputmethod/InputMethod.SessionCallback callback) ` Instantiate a new client session for the input method, by calling back to `https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService#onCreateInputMethodSessionInterface()`. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService.AbstractInputMethodImpl#revokeSession(android.view.inputmethod.InputMethodSession)(https://developer.android.com/reference/android/view/inputmethod/InputMethodSession session) ` Take care of killing an existing session by calling its `https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService.AbstractInputMethodSessionImpl#revokeSelf()` method. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService.AbstractInputMethodImpl#setSessionEnabled(android.view.inputmethod.InputMethodSession,%20boolean)(https://developer.android.com/reference/android/view/inputmethod/InputMethodSession session, boolean enabled) ` Take care of enabling or disabling an existing session by calling its `https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService.AbstractInputMethodSessionImpl#revokeSelf()` method. |

### Inherited methods

From class `

https://developer.android.com/reference/java/lang/Object

` `


https://developer.android.com/reference/java/lang/Object` `
https://developer.android.com/reference/java/lang/Object#clone()()
`

Creates and returns a copy of this object.


`


boolean` `
https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj)
`

Indicates whether some other object is "equal to" this one.


`


void` `
https://developer.android.com/reference/java/lang/Object#finalize()()
`

Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.


`


final

https://developer.android.com/reference/java/lang/Class<?>` `
https://developer.android.com/reference/java/lang/Object#getClass()()
`

Returns the runtime class of this `Object`.


`


int` `
https://developer.android.com/reference/java/lang/Object#hashCode()()
`

Returns a hash code value for the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notify()()
`

Wakes up a single thread that is waiting on this object's
monitor.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notifyAll()()
`

Wakes up all threads that are waiting on this object's monitor.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/java/lang/Object#toString()()
`

Returns a string representation of the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(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` `
https://developer.android.com/reference/java/lang/Object#wait(long)(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` `
https://developer.android.com/reference/java/lang/Object#wait()()
`

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


From interface `

https://developer.android.com/reference/android/view/inputmethod/InputMethod

` `
abstract


void` `
https://developer.android.com/reference/android/view/inputmethod/InputMethod#attachToken(android.os.IBinder)(https://developer.android.com/reference/android/os/IBinder token)
`

Called first thing after an input method is created, this supplies a
unique token for the session it has with the system service.


`
abstract


void` `
https://developer.android.com/reference/android/view/inputmethod/InputMethod#bindInput(android.view.inputmethod.InputBinding)(https://developer.android.com/reference/android/view/inputmethod/InputBinding binding)
`

Bind a new application environment in to the input method, so that it
can later start and stop input processing.


`
abstract


void` `
https://developer.android.com/reference/android/view/inputmethod/InputMethod#changeInputMethodSubtype(android.view.inputmethod.InputMethodSubtype)(https://developer.android.com/reference/android/view/inputmethod/InputMethodSubtype subtype)
`

Notify that the input method subtype is being changed in the same input method.


`
abstract


void` `
https://developer.android.com/reference/android/view/inputmethod/InputMethod#createSession(android.view.inputmethod.InputMethod.SessionCallback)(https://developer.android.com/reference/android/view/inputmethod/InputMethod.SessionCallback callback)
`

Create a new `https://developer.android.com/reference/android/view/inputmethod/InputMethodSession` that can be handed to client
applications for interacting with the input method.


`
abstract


void` `
https://developer.android.com/reference/android/view/inputmethod/InputMethod#hideSoftInput(int,%20android.os.ResultReceiver)(int flags, https://developer.android.com/reference/android/os/ResultReceiver resultReceiver)
`

Request that any soft input part of the input method be hidden from the user.


`
abstract


void` `
https://developer.android.com/reference/android/view/inputmethod/InputMethod#restartInput(android.view.inputmethod.InputConnection,%20android.view.inputmethod.EditorInfo)(https://developer.android.com/reference/android/view/inputmethod/InputConnection inputConnection, https://developer.android.com/reference/android/view/inputmethod/EditorInfo editorInfo)
`

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


`
abstract


void` `
https://developer.android.com/reference/android/view/inputmethod/InputMethod#revokeSession(android.view.inputmethod.InputMethodSession)(https://developer.android.com/reference/android/view/inputmethod/InputMethodSession session)
`

Disable and destroy a session that was previously created with
`https://developer.android.com/reference/android/view/inputmethod/InputMethod#createSession(android.view.inputmethod.InputMethod.SessionCallback)`.


`
abstract


void` `
https://developer.android.com/reference/android/view/inputmethod/InputMethod#setSessionEnabled(android.view.inputmethod.InputMethodSession,%20boolean)(https://developer.android.com/reference/android/view/inputmethod/InputMethodSession session, boolean enabled)
`

Control whether a particular input method session is active.


`
abstract


void` `
https://developer.android.com/reference/android/view/inputmethod/InputMethod#showSoftInput(int,%20android.os.ResultReceiver)(int flags, https://developer.android.com/reference/android/os/ResultReceiver resultReceiver)
`

Request that any soft input part of the input method be shown to the user.


`
abstract


void` `
https://developer.android.com/reference/android/view/inputmethod/InputMethod#startInput(android.view.inputmethod.InputConnection,%20android.view.inputmethod.EditorInfo)(https://developer.android.com/reference/android/view/inputmethod/InputConnection inputConnection, https://developer.android.com/reference/android/view/inputmethod/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.


`
abstract


void` `
https://developer.android.com/reference/android/view/inputmethod/InputMethod#unbindInput()()
`

Unbind an application environment, called when the information previously
set by `https://developer.android.com/reference/android/view/inputmethod/InputMethod#bindInput(android.view.inputmethod.InputBinding)` is no longer valid for this input method.


## Public constructors

### AbstractInputMethodImpl

```
public AbstractInputMethodImpl ()
```

<br />

<br />

## Public methods

### createSession

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void createSession (InputMethod.SessionCallback callback)
```

Instantiate a new client session for the input method, by calling
back to `https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService#onCreateInputMethodSessionInterface()`.


This method must be called from the main thread of your app.

<br />

| Parameters ||
|---|---|
| `callback` | `InputMethod.SessionCallback`: Interface that is called with the newly created session. <br /> |

### revokeSession

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void revokeSession (InputMethodSession session)
```

Take care of killing an existing session by calling its
`https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService.AbstractInputMethodSessionImpl#revokeSelf()` method.


This method must be called from the main thread of your app.

<br />

| Parameters ||
|---|---|
| `session` | `InputMethodSession`: The `https://developer.android.com/reference/android/view/inputmethod/InputMethodSession` previously provided through SessionCallback.sessionCreated() that is to be revoked. <br /> |

### setSessionEnabled

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setSessionEnabled (InputMethodSession session, 
                boolean enabled)
```

Take care of enabling or disabling an existing session by calling its
`https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService.AbstractInputMethodSessionImpl#revokeSelf()` method.


This method must be called from the main thread of your app.

<br />

| Parameters ||
|---|---|
| `session` | `InputMethodSession`: The `https://developer.android.com/reference/android/view/inputmethod/InputMethodSession` previously provided through SessionCallback.sessionCreated() that is to be changed. <br /> |
| `enabled` | `boolean` <br /> |