The Wayback Machine - https://web.archive.org/web/20171115140355/https://developer.android.com/reference/android/accessibilityservice/AccessibilityService.SoftKeyboardController.html
Skip to content

Most visited

Recently visited

navigation

AccessibilityService.SoftKeyboardController

public static final class AccessibilityService.SoftKeyboardController
extends Object

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


Used to control and query the soft keyboard show mode.

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.

Inherited methods

Image From class java.lang.Object

Public methods

addOnShowModeChangedListener

added in API level 24
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

handler Handler: the handler on which to callback should execute, or null to execute on the service's main thread

addOnShowModeChangedListener

added in API level 24
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 must never be null.

getShowMode

added in API level 24
int getShowMode ()

Returns the show mode of the soft keyboard. The default show mode is SHOW_MODE_AUTO, where the soft keyboard is shown when a text input field is focused. An AccessibilityService can also request the show mode SHOW_MODE_HIDDEN, where the soft keyboard is never shown.

Returns
int the current soft keyboard show mode

removeOnShowModeChangedListener

added in API level 24
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

Returns
boolean true if the listener was removed, false otherwise

setShowMode

added in API level 24
boolean setShowMode (int showMode)

Sets the soft keyboard show mode. The default show mode is SHOW_MODE_AUTO, where the soft keyboard is shown when a text input field is focused. An AccessibilityService can also request the show mode SHOW_MODE_HIDDEN, where the soft keyboard is never shown. The The lastto this method will be honored, regardless of any previous calls (including those made by other AccessibilityServices).

Note: If the service is not yet connected (e.g. 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

Returns
boolean true on success

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!

Follow Google Developers on WeChat

Image

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)