# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Nested Classes | Methods | Inherited Methods

# AccessibilityService.SoftKeyboardController

`public static final class AccessibilityService.SoftKeyboardController`
`extends Object` ``

java.lang.Object
↳ | android.accessibilityservice.AccessibilityService.SoftKeyboardController

Used to control, query, and listen for changes to the soft keyboard show mode.

Accessibility services may request to override the decisions normally made about whether or not the soft keyboard is shown.

If multiple services make conflicting requests, the last request is honored. A service may register a listener to find out if the mode has changed under it.

If the user takes action to override the behavior behavior requested by an accessibility service, the user's request takes precendence, the show mode will be reset to `AccessibilityService#SHOW_MODE_AUTO`, and services will no longer be able to control that aspect of the soft keyboard's behavior.

Note: Because soft keyboards are independent apps, the framework does not have total control over their behavior. They may choose to show themselves, or not, without regard to requests made here. So the framework will make a best effort to deliver the behavior requested, but cannot guarantee success.

See also:

- `AccessibilityService.SHOW_MODE_AUTO`
- `AccessibilityService.SHOW_MODE_HIDDEN`
- `AccessibilityService.SHOW_MODE_IGNORE_HARD_KEYBOARD`

## Summary

### Nested classes
`interface` | `AccessibilityService.SoftKeyboardController.OnShowModeChangedListener` Listener for changes in the soft keyboard show mode.

### Public methods
`void` | `addOnShowModeChangedListener(AccessibilityService.SoftKeyboardController.OnShowModeChangedListener listener, Handler handler)` Adds the specified change listener to the list of soft keyboard show mode change listeners.
`void` | `addOnShowModeChangedListener(AccessibilityService.SoftKeyboardController.OnShowModeChangedListener listener)` Adds the specified change listener to the list of show mode change listeners.
`int` | `getShowMode()` Returns the show mode of the soft keyboard.
`boolean` | `removeOnShowModeChangedListener(AccessibilityService.SoftKeyboardController.OnShowModeChangedListener listener)` Removes the specified change listener from the list of keyboard show mode change listeners.
`boolean` | `setShowMode(int showMode)` Sets the soft keyboard show mode.
`boolean` | `switchToInputMethod(String imeId)` Switches the current IME for the user for whom the service is enabled.

### Inherited methods
From class `java.lang.Object`
`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 timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.

## Public methods

### addOnShowModeChangedListener

    public void addOnShowModeChangedListener (AccessibilityService.SoftKeyboardController.OnShowModeChangedListener listener,
                    Handler handler)

Adds the specified change listener to the list of soft keyboard show mode change listeners. The callback will occur on the specified `Handler`'s thread, or on the services's main thread if the handler is `null`.

Parameters
`listener` | `AccessibilityService.SoftKeyboardController.OnShowModeChangedListener`: the listener to add, must be non-null This value cannot be `null`.
`handler` | `Handler`: the handler on which to callback should execute, or `null` to execute on the service's main thread This value may be `null`.

### addOnShowModeChangedListener

    public void addOnShowModeChangedListener (AccessibilityService.SoftKeyboardController.OnShowModeChangedListener listener)

Adds the specified change listener to the list of show mode change listeners. The callback will occur on the service's main thread. Listener is not called on registration.

Parameters
`listener` | `AccessibilityService.SoftKeyboardController.OnShowModeChangedListener`: This value cannot be `null`.

### getShowMode

    public int getShowMode ()

Returns the show mode of the soft keyboard.

Returns
`int` | the current soft keyboard show mode Value is `AccessibilityService.SHOW_MODE_AUTO`, `AccessibilityService.SHOW_MODE_HIDDEN`, or `AccessibilityService.SHOW_MODE_IGNORE_HARD_KEYBOARD`

See also:

- `AccessibilityService.SHOW_MODE_AUTO`
- `AccessibilityService.SHOW_MODE_HIDDEN`
- `AccessibilityService.SHOW_MODE_IGNORE_HARD_KEYBOARD`

### removeOnShowModeChangedListener

    public boolean removeOnShowModeChangedListener (AccessibilityService.SoftKeyboardController.OnShowModeChangedListener listener)

Removes the specified change listener from the list of keyboard show mode change listeners.

Parameters
`listener` | `AccessibilityService.SoftKeyboardController.OnShowModeChangedListener`: the listener to remove, must be non-null This value cannot be `null`.

Returns
`boolean` | `true` if the listener was removed, `false` otherwise

### setShowMode

    public boolean setShowMode (int showMode)

Sets the soft keyboard show mode.

Note: If the service is not yet connected (e.g. `AccessibilityService#onServiceConnected()` has not yet been called) or the service has been disconnected, this method will have no effect and return `false`.

Parameters
`showMode` | `int`: the new show mode for the soft keyboard Value is `AccessibilityService.SHOW_MODE_AUTO`, `AccessibilityService.SHOW_MODE_HIDDEN`, or `AccessibilityService.SHOW_MODE_IGNORE_HARD_KEYBOARD`

Returns
`boolean` | `true` on success

See also:

- `AccessibilityService.SHOW_MODE_AUTO`
- `AccessibilityService.SHOW_MODE_HIDDEN`
- `AccessibilityService.SHOW_MODE_IGNORE_HARD_KEYBOARD`

### switchToInputMethod

    public boolean switchToInputMethod (String imeId)

Switches the current IME for the user for whom the service is enabled. The change will persist until the current IME is explicitly changed again, and may persist beyond the life cycle of the requesting service.

Parameters
`imeId` | `String`: The ID of the input method to make current. This IME must be installed and enabled. This value cannot be `null`.

Returns
`boolean` | `true` if the current input method was successfully switched to the input method by `imeId`, `false` if the input method specified is not installed, not enabled, or otherwise not available to become the current IME

See also:

- `InputMethodInfo.getId()`

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*