Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/inputmethodservice/InputMethodService#nestedclasses) \| [XML Attrs](https://developer.android.com/reference/android/inputmethodservice/InputMethodService#lattrs) \| [Constants](https://developer.android.com/reference/android/inputmethodservice/InputMethodService#constants) \| [Inherited Constants](https://developer.android.com/reference/android/inputmethodservice/InputMethodService#inhconstants) \| [Ctors](https://developer.android.com/reference/android/inputmethodservice/InputMethodService#pubctors) \| [Methods](https://developer.android.com/reference/android/inputmethodservice/InputMethodService#pubmethods) \| [Protected Methods](https://developer.android.com/reference/android/inputmethodservice/InputMethodService#promethods) \| [Inherited Methods](https://developer.android.com/reference/android/inputmethodservice/InputMethodService#inhmethods)

# InputMethodService

*** ** * ** ***


`
public


class
InputMethodService
`


`


`

`


`

`


`

`


`

`

extends https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService


`

`


`

|---|---|---|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||||||
| ↳ | [android.content.Context](https://developer.android.com/reference/android/content/Context) |||||
|   | ↳ | [android.content.ContextWrapper](https://developer.android.com/reference/android/content/ContextWrapper) ||||
|   |   | ↳ | [android.app.Service](https://developer.android.com/reference/android/app/Service) |||
|   |   |   | ↳ | [android.inputmethodservice.AbstractInputMethodService](https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService) ||
|   |   |   |   | ↳ | android.inputmethodservice.InputMethodService |

<br />

*** ** * ** ***

InputMethodService provides a standard implementation of an InputMethod,
which final implementations can derive from and customize. See the
base class `https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService` and the `https://developer.android.com/reference/android/view/inputmethod/InputMethod`
interface for more information on the basics of writing input methods.

In addition to the normal Service lifecycle methods, this class
introduces some new specific callbacks that most subclasses will want
to make use of:

- `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onInitializeInterface()` for user-interface initialization, in particular to deal with configuration changes while the service is running.
- `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onBindInput()` to find out about switching to a new client.
- `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onStartInput(android.view.inputmethod.EditorInfo,%20boolean)` to deal with an input session starting with the client.
- `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onCreateInputView()`, `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onCreateCandidatesView()`, and `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onCreateExtractTextView()` for non-demand generation of the UI.
- `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onStartInputView(android.view.inputmethod.EditorInfo,%20boolean)` to deal with input starting within the input area of the IME.

An input method has significant discretion in how it goes about its
work: the `https://developer.android.com/reference/android/inputmethodservice/InputMethodService` provides
a basic framework for standard UI elements (input view, candidates view,
and running in fullscreen mode), but it is up to a particular implementor
to decide how to use them. For example, one input method could implement
an input area with a keyboard, another could allow the user to draw text,
while a third could have no input area (and thus not be visible to the
user) but instead listen to audio and perform text to speech conversion.

In the implementation provided here, all of these elements are placed
together in a single window managed by the InputMethodService. It will
execute callbacks as it needs information about them, and provides APIs for
programmatic control over them. They layout of these elements is explicitly
defined:

- The soft input view, if available, is placed at the bottom of the screen.
- The candidates view, if currently shown, is placed above the soft input view.
- If not running fullscreen, the application is moved or resized to be above these views; if running fullscreen, the window will completely cover the application and its top part will contain the extract text of what is currently being edited by the application.

### Soft Input View

Central to most input methods is the soft input view. This is where most
user interaction occurs: pressing on soft keys, drawing characters, or
however else your input method wants to generate text. Most implementations
will simply have their own view doing all of this work, and return a new
instance of it when `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onCreateInputView()` is called. At that point,
as long as the input view is visible, you will see user interaction in
that view and can call back on the InputMethodService to interact with the
application as appropriate.

There are some situations where you want to decide whether or not your
soft input view should be shown to the user. This is done by implementing
the `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onEvaluateInputViewShown()` to return true or false based on
whether it should be shown in the current environment. If any of your
state has changed that may impact this, call
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService#updateInputViewShown()` to have it re-evaluated. The default
implementation always shows the input view unless there is a hard
keyboard available, which is the appropriate behavior for most input
methods.

### Candidates View

Often while the user is generating raw text, an input method wants to
provide them with a list of possible interpretations of that text that can
be selected for use. This is accomplished with the candidates view, and
like the soft input view you implement `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onCreateCandidatesView()`
to instantiate your own view implementing your candidates UI.

Management of the candidates view is a little different than the input
view, because the candidates view tends to be more transient, being shown
only when there are possible candidates for the current text being entered
by the user. To control whether the candidates view is shown, you use
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService#setCandidatesViewShown(boolean)`. Note that because the candidate
view tends to be shown and hidden a lot, it does not impact the application
UI in the same way as the soft input view: it will never cause application
windows to resize, only cause them to be panned if needed for the user to
see the current focus.

### Fullscreen Mode

Sometimes your input method UI is too large to integrate with the
application UI, so you just want to take over the screen. This is
accomplished by switching to full-screen mode, causing the input method
window to fill the entire screen and add its own "extracted text" editor
showing the user the text that is being typed. Unlike the other UI elements,
there is a standard implementation for the extract editor that you should
not need to change. The editor is placed at the top of the IME, above the
input and candidates views.

Similar to the input view, you control whether the IME is running in
fullscreen mode by implementing `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onEvaluateFullscreenMode()`
to return true or false based on
whether it should be fullscreen in the current environment. If any of your
state has changed that may impact this, call
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService#updateFullscreenMode()` to have it re-evaluated. The default
implementation selects fullscreen mode when the screen is in a landscape
orientation, which is appropriate behavior for most input methods that have
a significant input area.

When in fullscreen mode, you have some special requirements because the
user can not see the application UI. In particular, you should implement
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onDisplayCompletions(android.view.inputmethod.CompletionInfo[])` to show completions
generated by your application, typically in your candidates view like you
would normally show candidates.


### Generating Text

The key part of an IME is of course generating text for the application.
This is done through calls to the
`https://developer.android.com/reference/android/view/inputmethod/InputConnection` interface to the
application, which can be retrieved from `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#getCurrentInputConnection()`.
This interface allows you to generate raw key events or, if the target
supports it, directly edit in strings of candidates and committed text.

Information about what the target is expected and supports can be found
through the `https://developer.android.com/reference/android/view/inputmethod/EditorInfo` class, which is
retrieved with `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#getCurrentInputEditorInfo()` method. The most
important part of this is `https://developer.android.com/reference/android/view/inputmethod/EditorInfo#inputType`; in particular, if this is
`https://developer.android.com/reference/android/text/InputType#TYPE_NULL`,
then the target does not support complex edits and you need to only deliver
raw key events to it. An input method will also want to look at other
values here, to for example detect password mode, auto complete text views,
phone number entry, etc.

When the user switches between input targets, you will receive calls to
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onFinishInput()` and `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onStartInput(android.view.inputmethod.EditorInfo,%20boolean)`.
You can use these to reset and initialize your input state for the current
target. For example, you will often want to clear any input state, and
update a soft keyboard to be appropriate for the new inputType.

<br />

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `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. |
| ` class` | `https://developer.android.com/reference/android/inputmethodservice/InputMethodService.InputMethodSessionImpl` Concrete implementation of `https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService.AbstractInputMethodSessionImpl` that provides all of the standard behavior for an input method session. |
| ` class` | `https://developer.android.com/reference/android/inputmethodservice/InputMethodService.Insets` Information about where interesting parts of the input method UI appear. |

| ### XML attributes ||
|---|---|
| [`android:imeExtractEnterAnimation`](https://developer.android.com/reference/android/inputmethodservice/InputMethodService#attr_android:imeExtractEnterAnimation) | Animation to use when showing the fullscreen extract UI after it had previously been hidden. |
| [`android:imeExtractExitAnimation`](https://developer.android.com/reference/android/inputmethodservice/InputMethodService#attr_android:imeExtractExitAnimation) | Animation to use when hiding the fullscreen extract UI after it had previously been shown. |
| [`android:imeFullscreenBackground`](https://developer.android.com/reference/android/inputmethodservice/InputMethodService#attr_android:imeFullscreenBackground) | Background to use for entire input method when it is being shown in fullscreen mode with the extract view, to ensure that it completely covers the application. |

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#BACK_DISPOSITION_ADJUST_NOTHING` Asks the system to not adjust the back button affordance even when the software keyboard is shown. |
| `int` | `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#BACK_DISPOSITION_DEFAULT` Allows the system to optimize the back button affordance based on the presence of software keyboard. |
| `int` | `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#BACK_DISPOSITION_WILL_DISMISS` *This constant was deprecated in API level 28. on `https://developer.android.com/reference/android/os/Build.VERSION_CODES#P` and later devices, this flag is handled as a synonym of `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#BACK_DISPOSITION_DEFAULT`. On `https://developer.android.com/reference/android/os/Build.VERSION_CODES#O_MR1` and prior devices, expected behavior of this mode had not been well defined. In AOSP implementation running on devices that have navigation bar, specifying this flag could change the software back button to "Dismiss" icon no matter whether the software keyboard is shown or not, but there would be no easy way to restore the icon state even after IME lost the connection to the application. To avoid user confusions, do not specify this mode anyway* |
| `int` | `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#BACK_DISPOSITION_WILL_NOT_DISMISS` *This constant was deprecated in API level 28. on `https://developer.android.com/reference/android/os/Build.VERSION_CODES#P` and later devices, this flag is handled as a synonym of `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#BACK_DISPOSITION_DEFAULT`. On `https://developer.android.com/reference/android/os/Build.VERSION_CODES#O_MR1` and prior devices, expected behavior of this mode had not been well defined. Most likely the end result would be the same as `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#BACK_DISPOSITION_DEFAULT`. Either way it is not recommended to use this mode* |

### Inherited constants

From class `https://developer.android.com/reference/android/app/Service` `int` `https://developer.android.com/reference/android/app/Service#START_CONTINUATION_MASK`

Bits returned by `https://developer.android.com/reference/android/app/Service#onStartCommand(android.content.Intent,%20int,%20int)` describing how to continue
the service if it is killed.


`int` `https://developer.android.com/reference/android/app/Service#START_FLAG_REDELIVERY`

This flag is set in `https://developer.android.com/reference/android/app/Service#onStartCommand(android.content.Intent,%20int,%20int)` if the Intent is a
re-delivery of a previously delivered intent, because the service
had previously returned `https://developer.android.com/reference/android/app/Service#START_REDELIVER_INTENT` but had been
killed before calling `https://developer.android.com/reference/android/app/Service#stopSelf(int)` for that Intent.


`int` `https://developer.android.com/reference/android/app/Service#START_FLAG_RETRY`

This flag is set in `https://developer.android.com/reference/android/app/Service#onStartCommand(android.content.Intent,%20int,%20int)` if the Intent is a
retry because the original attempt never got to or returned from
`https://developer.android.com/reference/android/app/Service#onStartCommand(android.content.Intent,%20int,%20int)`.


`int` `https://developer.android.com/reference/android/app/Service#START_NOT_STICKY`

Constant to return from `https://developer.android.com/reference/android/app/Service#onStartCommand(android.content.Intent,%20int,%20int)`: if this service's
process is killed while it is started (after returning from
`https://developer.android.com/reference/android/app/Service#onStartCommand(android.content.Intent,%20int,%20int)`), and there are no new start intents to
deliver to it, then take the service out of the started state and
don't recreate until a future explicit call to
`https://developer.android.com/reference/android/content/Context#startService(android.content.Intent)`.


`int` `https://developer.android.com/reference/android/app/Service#START_REDELIVER_INTENT`

Constant to return from `https://developer.android.com/reference/android/app/Service#onStartCommand(android.content.Intent,%20int,%20int)`: if this service's
process is killed while it is started (after returning from
`https://developer.android.com/reference/android/app/Service#onStartCommand(android.content.Intent,%20int,%20int)`), then it will be scheduled for a restart
and the last delivered Intent re-delivered to it again via
`https://developer.android.com/reference/android/app/Service#onStartCommand(android.content.Intent,%20int,%20int)`.


`int` `https://developer.android.com/reference/android/app/Service#START_STICKY`

Constant to return from `https://developer.android.com/reference/android/app/Service#onStartCommand(android.content.Intent,%20int,%20int)`: if this service's
process is killed while it is started (after returning from
`https://developer.android.com/reference/android/app/Service#onStartCommand(android.content.Intent,%20int,%20int)`), then leave it in the started state but
don't retain this delivered intent.


`int` `https://developer.android.com/reference/android/app/Service#START_STICKY_COMPATIBILITY`

Constant to return from `https://developer.android.com/reference/android/app/Service#onStartCommand(android.content.Intent,%20int,%20int)`: compatibility
version of `https://developer.android.com/reference/android/app/Service#START_STICKY` that does not guarantee that
`https://developer.android.com/reference/android/app/Service#onStartCommand(android.content.Intent,%20int,%20int)` will be called again after being killed.


`int` `https://developer.android.com/reference/android/app/Service#STOP_FOREGROUND_DETACH`

Selector for `https://developer.android.com/reference/android/app/Service#stopForeground(int)`: if set, the notification previously supplied
to `https://developer.android.com/reference/android/app/Service#startForeground(int,%20android.app.Notification)` will be detached from the service's lifecycle.


`int` `https://developer.android.com/reference/android/app/Service#STOP_FOREGROUND_LEGACY`

*This constant was deprecated
in API level 33.
Use `https://developer.android.com/reference/android/app/Service#STOP_FOREGROUND_DETACH` instead. The legacy
behavior was inconsistent, leading to bugs around unpredictable results.*


`int` `https://developer.android.com/reference/android/app/Service#STOP_FOREGROUND_REMOVE`

Selector for `https://developer.android.com/reference/android/app/Service#stopForeground(int)`: if supplied, the notification previously
supplied to `https://developer.android.com/reference/android/app/Service#startForeground(int,%20android.app.Notification)` will be cancelled and removed from display.


From class `https://developer.android.com/reference/android/content/Context` `https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#ACCESSIBILITY_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/view/accessibility/AccessibilityManager` for giving the user
feedback for UI events through the registered event listeners.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#ACCOUNT_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/accounts/AccountManager` for receiving intents at a
time of your choosing.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#ACTIVITY_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/app/ActivityManager` for interacting with the global
system state.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#ADVANCED_PROTECTION_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve an
`https://developer.android.com/reference/android/security/advancedprotection/AdvancedProtectionManager`


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#ALARM_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/app/AlarmManager` for receiving intents at a
time of your choosing.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#APPWIDGET_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/appwidget/AppWidgetManager` for accessing AppWidgets.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#APP_FUNCTION_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve an
`https://developer.android.com/reference/android/app/appfunctions/AppFunctionManager` for
executing app functions.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#APP_INTERACTION_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve an
`https://developer.android.com/reference/android/app/AppInteractionManager` for managing app interactions.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#APP_OPS_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/app/AppOpsManager` for tracking application operations
on the device.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#APP_SEARCH_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve an
`https://developer.android.com/reference/android/app/appsearch/AppSearchManager` for
indexing and querying app data managed by the system.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#AUDIO_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/media/AudioManager` for handling management of volume,
ringer modes and audio routing.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#AUTHENTICATION_POLICY_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve an `https://developer.android.com/reference/android/security/authenticationpolicy/AuthenticationPolicyManager`.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#AUTOFILL_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve an
`https://developer.android.com/reference/android/view/autofill/AutofillManager`.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#BATTERY_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/os/BatteryManager` for managing battery state.


`int` `https://developer.android.com/reference/android/content/Context#BIND_ABOVE_CLIENT`

Flag for `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`: indicates that the client application
binding to this service considers the service to be more important than
the app itself.


`int` `https://developer.android.com/reference/android/content/Context#BIND_ADJUST_WITH_ACTIVITY`

Flag for `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`: If binding from an activity, allow the
target service's process importance to be raised based on whether the
activity is visible to the user, regardless whether another flag is
used to reduce the amount that the client process's overall importance
is used to impact it.


`int` `https://developer.android.com/reference/android/content/Context#BIND_ALLOW_ACTIVITY_STARTS`

Flag for `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`: If binding from an app that is visible, the bound service is
allowed to start an activity from background.


`int` `https://developer.android.com/reference/android/content/Context#BIND_ALLOW_OOM_MANAGEMENT`

Flag for `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`: allow the process hosting the bound
service to go through its normal memory management.


`int` `https://developer.android.com/reference/android/content/Context#BIND_AUTO_CREATE`

Flag for `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`: automatically create the service as long
as the binding exists.


`int` `https://developer.android.com/reference/android/content/Context#BIND_DEBUG_UNBIND`

Flag for `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`: include debugging help for mismatched
calls to unbind.


`int` `https://developer.android.com/reference/android/content/Context#BIND_EXTERNAL_SERVICE`

Flag for `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`: The service being bound is an
`https://developer.android.com/reference/android/R.attr#isolatedProcess`,
`https://developer.android.com/reference/android/R.attr#externalService` service.


`long` `https://developer.android.com/reference/android/content/Context#BIND_EXTERNAL_SERVICE_LONG`

Works in the same way as `https://developer.android.com/reference/android/content/Context#BIND_EXTERNAL_SERVICE`, but it's defined as a `long`
value that is compatible to `https://developer.android.com/reference/android/content/Context.BindServiceFlags`.


`int` `https://developer.android.com/reference/android/content/Context#BIND_IMPORTANT`

Flag for `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`: this service is very important to
the client, so should be brought to the foreground process level
when the client is.


`int` `https://developer.android.com/reference/android/content/Context#BIND_INCLUDE_CAPABILITIES`

Flag for `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`: If binding from an app that has specific capabilities
due to its foreground state such as an activity or foreground service, then this flag will
allow the bound app to get the same capabilities, as long as it has the required permissions
as well.


`int` `https://developer.android.com/reference/android/content/Context#BIND_NOT_FOREGROUND`

Flag for `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`: don't allow this binding to raise
the target service's process to the foreground scheduling priority.


`int` `https://developer.android.com/reference/android/content/Context#BIND_NOT_PERCEPTIBLE`

Flag for `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`: If binding from an app that is visible or user-perceptible,
lower the target service's importance to below the perceptible level.


`int` `https://developer.android.com/reference/android/content/Context#BIND_PACKAGE_ISOLATED_PROCESS`

Flag for `https://developer.android.com/reference/android/content/Context#bindIsolatedService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.lang.String,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`: Bind the service into a shared isolated process,
but only with other isolated services from the same package that declare the same process
name.


`int` `https://developer.android.com/reference/android/content/Context#BIND_SHARED_ISOLATED_PROCESS`

Flag for `https://developer.android.com/reference/android/content/Context#bindIsolatedService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.lang.String,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`: Bind the service into a shared isolated process.


`int` `https://developer.android.com/reference/android/content/Context#BIND_WAIVE_PRIORITY`

Flag for `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`: don't impact the scheduling or
memory management priority of the target service's hosting process.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#BIOMETRIC_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/hardware/biometrics/BiometricManager` for handling
biometric and PIN/pattern/password authentication.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#BLOB_STORE_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/app/blob/BlobStoreManager` for contributing and accessing data blobs
from the blob store maintained by the system.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#BLUETOOTH_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/bluetooth/BluetoothManager` for using Bluetooth.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#BUGREPORT_SERVICE`

Service to capture a bugreport.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#CAMERA_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/hardware/camera2/CameraManager` for interacting with
camera devices.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#CAPTIONING_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/view/accessibility/CaptioningManager` for obtaining
captioning properties and listening for changes in captioning
preferences.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#CARRIER_CONFIG_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/telephony/CarrierConfigManager` for reading carrier configuration values.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#CHOOSER_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/service/chooser/ChooserManager`.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#CLIPBOARD_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/content/ClipboardManager` for accessing and modifying
the contents of the global clipboard.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#COMPANION_DEVICE_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/companion/CompanionDeviceManager` for managing companion devices


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#CONNECTIVITY_DIAGNOSTICS_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/net/ConnectivityDiagnosticsManager` for performing network connectivity diagnostics
as well as receiving network connectivity information from the system.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#CONNECTIVITY_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/net/ConnectivityManager` for handling management of
network connections.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#CONSUMER_IR_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/hardware/ConsumerIrManager` for transmitting infrared
signals from the device.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#CONTACT_KEYS_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/provider/E2eeContactKeysManager` to managing contact keys.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#CONTENT_RESTRICTION_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/app/contentsafety/ContentSafetyManager`.


`int` `https://developer.android.com/reference/android/content/Context#CONTEXT_IGNORE_SECURITY`

Flag for use with `https://developer.android.com/reference/android/content/Context#createPackageContext(java.lang.String,%20int)`: ignore any security
restrictions on the Context being requested, allowing it to always
be loaded.


`int` `https://developer.android.com/reference/android/content/Context#CONTEXT_INCLUDE_CODE`

Flag for use with `https://developer.android.com/reference/android/content/Context#createPackageContext(java.lang.String,%20int)`: include the application
code with the context.


`int` `https://developer.android.com/reference/android/content/Context#CONTEXT_RESTRICTED`

Flag for use with `https://developer.android.com/reference/android/content/Context#createPackageContext(java.lang.String,%20int)`: a restricted context may
disable specific features.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#CREDENTIAL_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/credentials/CredentialManager` to authenticate a user to your app.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#CROSS_PROFILE_APPS_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/content/pm/CrossProfileApps` for cross profile operations.


`int` `https://developer.android.com/reference/android/content/Context#DEVICE_ID_DEFAULT`

The default device ID, which is the ID of the primary (non-virtual) device.


`int` `https://developer.android.com/reference/android/content/Context#DEVICE_ID_INVALID`

Invalid device ID.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#DEVICE_LOCK_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/devicelock/DeviceLockManager`.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#DEVICE_POLICY_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/app/admin/DevicePolicyManager` for working with global
device policy management.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#DISPLAY_HASH_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to access
`https://developer.android.com/reference/android/view/displayhash/DisplayHashManager` to handle display hashes.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#DISPLAY_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/hardware/display/DisplayManager` for interacting with display devices.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#DOMAIN_VERIFICATION_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to access
`https://developer.android.com/reference/android/content/pm/verify/domain/DomainVerificationManager` to retrieve approval and
user state for declared web domains.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#DOWNLOAD_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/app/DownloadManager` for requesting HTTP downloads.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#DROPBOX_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/os/DropBoxManager` instance for recording
diagnostic logs.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#EUICC_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/telephony/euicc/EuiccManager` to manage the device eUICC (embedded SIM).


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#FILE_INTEGRITY_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve an
`https://developer.android.com/reference/android/security/FileIntegrityManager`.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#FILE_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/os/storage/FileManager` for handling file operations.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#GAME_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/app/GameManager`.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#GRAMMATICAL_INFLECTION_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/app/GrammaticalInflectionManager`.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#HARDWARE_PROPERTIES_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/os/HardwarePropertiesManager` for accessing the hardware properties service.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#HEALTHCONNECT_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/health/connect/HealthConnectManager`.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#HID_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/hardware/hid/HidManager` for interacting with HID devices.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#INPUT_METHOD_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/view/inputmethod/InputMethodManager` for accessing input
methods.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#INPUT_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/hardware/input/InputManager` for interacting with input devices.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#IPSEC_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/net/IpSecManager` for encrypting Sockets or Networks with
IPSec.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#JOB_SCHEDULER_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/app/job/JobScheduler` instance for managing occasional
background tasks.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#KEYCHAIN_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/security/KeyChainManager` for managing KeyChain certificates and grants.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#KEYGUARD_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/app/KeyguardManager` for controlling keyguard.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#KEYSTORE_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/security/keystore/KeyStoreManager` for accessing
[Android Keystore](https://developer.android.com/privacy-and-security/keystore)
functions.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#LAUNCHER_APPS_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/content/pm/LauncherApps` for querying and monitoring launchable apps across
profiles of a user.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#LAYOUT_INFLATER_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/view/LayoutInflater` for inflating layout resources in this
context.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#LOCALE_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/app/LocaleManager`.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#LOCATION_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/location/LocationManager` for controlling location
updates.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#MEDIA_COMMUNICATION_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/media/MediaCommunicationManager`
for managing `https://developer.android.com/reference/android/media/MediaSession2`.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#MEDIA_METRICS_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/media/metrics/MediaMetricsManager` for interacting with media metrics
on the device.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#MEDIA_PROJECTION_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/media/projection/MediaProjectionManager` instance for managing
media projection sessions.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#MEDIA_QUALITY_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/media/quality/MediaQualityManager` for standardize picture
and audio API parameters.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#MEDIA_ROUTER_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.Class<T>)` to retrieve a
`https://developer.android.com/reference/android/media/MediaRouter` for controlling and managing
routing of media.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#MEDIA_SESSION_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/media/session/MediaSessionManager` for managing media Sessions.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#MEMORY_BUDGET_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/app/MemoryBudgetManager` for monitoring memory budgets.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#MIDI_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/media/midi/MidiManager` for accessing the MIDI service.


`int` `https://developer.android.com/reference/android/content/Context#MODE_APPEND`

File creation mode: for use with `https://developer.android.com/reference/android/content/Context#openFileOutput(java.lang.String,%20int)`, if the file
already exists then write data to the end of the existing file
instead of erasing it.


`int` `https://developer.android.com/reference/android/content/Context#MODE_ENABLE_WRITE_AHEAD_LOGGING`

Database open flag: when set, the database is opened with write-ahead
logging enabled by default.


`int` `https://developer.android.com/reference/android/content/Context#MODE_MULTI_PROCESS`

*This constant was deprecated
in API level 23.
MODE_MULTI_PROCESS does not work reliably in
some versions of Android, and furthermore does not provide any
mechanism for reconciling concurrent modifications across
processes. Applications should not attempt to use it. Instead,
they should use an explicit cross-process data management
approach such as `https://developer.android.com/reference/android/content/ContentProvider`.*


`int` `https://developer.android.com/reference/android/content/Context#MODE_NO_LOCALIZED_COLLATORS`

Database open flag: when set, the database is opened without support for
localized collators.


`int` `https://developer.android.com/reference/android/content/Context#MODE_PRIVATE`

File creation mode: the default mode, where the created file can only
be accessed by the calling application (or all applications sharing the
same user ID).


`int` `https://developer.android.com/reference/android/content/Context#MODE_WORLD_READABLE`

*This constant was deprecated
in API level 17.
Creating world-readable files is very dangerous, and likely
to cause security holes in applications. It is strongly
discouraged; instead, applications should use more formal
mechanism for interactions such as `https://developer.android.com/reference/android/content/ContentProvider`,
`https://developer.android.com/reference/android/content/BroadcastReceiver`, and `https://developer.android.com/reference/android/app/Service`.
There are no guarantees that this access mode will remain on
a file, such as when it goes through a backup and restore.*


`int` `https://developer.android.com/reference/android/content/Context#MODE_WORLD_WRITEABLE`

*This constant was deprecated
in API level 17.
Creating world-writable files is very dangerous, and likely
to cause security holes in applications. It is strongly
discouraged; instead, applications should use more formal
mechanism for interactions such as `https://developer.android.com/reference/android/content/ContentProvider`,
`https://developer.android.com/reference/android/content/BroadcastReceiver`, and `https://developer.android.com/reference/android/app/Service`.
There are no guarantees that this access mode will remain on
a file, such as when it goes through a backup and restore.*


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#MULTISENSORY_MANAGER_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve the service that plays multisensory
feedback.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#NETWORK_STATS_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/app/usage/NetworkStatsManager` for querying network usage stats.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#NFC_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/nfc/NfcManager` for using NFC.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#NOTIFICATION_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/app/NotificationManager` for informing the user of
background events.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#NPU_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/`.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#NSD_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/net/nsd/NsdManager` for handling management of network service
discovery


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#OVERLAY_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/content/om/OverlayManager` for managing overlay packages.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#PCC_SANDBOX_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/app/privatecompute/PccSandboxManager`.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#PEOPLE_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to access a `https://developer.android.com/reference/android/app/people/PeopleManager` to interact
with your published conversations.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#PERFORMANCE_HINT_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/os/PerformanceHintManager` for accessing the performance hinting service.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#PERSISTENT_DATA_BLOCK_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/service/persistentdata/PersistentDataBlockManager` instance
for interacting with a storage device that lives across factory resets.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#POWER_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/os/PowerManager` for controlling power management,
including "wake locks," which let you keep the device on while
you're running long tasks.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#PRINT_SERVICE`

`https://developer.android.com/reference/android/print/PrintManager` for printing and managing
printers and print tasks.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#PROFILING_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve an
`https://developer.android.com/reference/android/os/ProfilingManager`.


`int` `https://developer.android.com/reference/android/content/Context#RECEIVER_EXPORTED`

Flag for `https://developer.android.com/reference/android/content/Context#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter)`: The receiver can receive broadcasts from other Apps.


`int` `https://developer.android.com/reference/android/content/Context#RECEIVER_NOT_EXPORTED`

Flag for `https://developer.android.com/reference/android/content/Context#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter)`: The receiver cannot receive broadcasts from other Apps.


`int` `https://developer.android.com/reference/android/content/Context#RECEIVER_VISIBLE_TO_INSTANT_APPS`

Flag for `https://developer.android.com/reference/android/content/Context#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter)`: The receiver can receive broadcasts from Instant Apps.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#RESTRICTIONS_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/content/RestrictionsManager` for retrieving application restrictions
and requesting permissions for restricted operations.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#ROLE_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/app/role/RoleManager`
for managing roles.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#SATELLITE_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/telephony/satellite/SatelliteManager` for accessing satellite functionality.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#SEARCH_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/app/SearchManager` for handling searches.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#SECURITY_STATE_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/os/SecurityStateManager` for accessing the security state manager service.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#SENSOR_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/hardware/SensorManager` for accessing sensors.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#SERIAL_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/hardware/serial/SerialManager` for access to serial ports.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#SHORTCUT_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/content/pm/ShortcutManager` for accessing the launcher shortcut service.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#STATUS_BAR_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/app/StatusBarManager` for interacting with the status bar and quick settings.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#STORAGE_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/os/storage/StorageManager` for accessing system storage
functions.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#STORAGE_STATS_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/app/usage/StorageStatsManager` for accessing system storage
statistics.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#SYSTEM_HEALTH_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/os/health/SystemHealthManager` for accessing system health (battery, power,
memory, etc) metrics.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#TELECOM_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/telecom/TelecomManager` to manage telecom-related features
of the device.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#TELEPHONY_IMS_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve an
`https://developer.android.com/reference/android/telephony/ims/ImsManager`.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#TELEPHONY_PHONE_NUMBER_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/telephony/PhoneNumberManager` for parsing phone numbers.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#TELEPHONY_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/telephony/TelephonyManager` for handling management the
telephony features of the device.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#TELEPHONY_SUBSCRIPTION_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/telephony/SubscriptionManager` for handling management the
telephony subscriptions of the device.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#TETHERING_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/net/TetheringManager`
for managing tethering functions.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#TEXT_CLASSIFICATION_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/view/textclassifier/TextClassificationManager` for text classification services.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#TEXT_SERVICES_MANAGER_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/view/textservice/TextServicesManager` for accessing
text services.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#TIME_MANAGER_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/app/time/TimeManager`.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#TV_AD_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/media/tv/ad/TvAdManager` for interacting with TV client-side advertisement
services on the device.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#TV_INPUT_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/media/tv/TvInputManager` for interacting with TV inputs
on the device.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#TV_INTERACTIVE_APP_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/media/tv/interactive/TvInteractiveAppManager` for interacting with TV
interactive applications on the device.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#UI_MODE_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/app/UiModeManager` for controlling UI modes.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#USAGE_STATS_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/app/usage/UsageStatsManager` for querying device usage stats.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#USB_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/hardware/usb/UsbManager` for access to USB devices (as a USB host)
and for controlling this device's behavior as a USB device.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#USER_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/os/UserManager` for managing users on devices that support multiple users.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#VIBRATOR_MANAGER_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/os/VibratorManager`
for accessing the device vibrators, interacting with individual ones and playing synchronized
effects on multiple vibrators.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#VIBRATOR_SERVICE`

*This constant was deprecated
in API level 31.
Use `https://developer.android.com/reference/android/os/VibratorManager` to retrieve the default system vibrator.*


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#VIRTUAL_DEVICE_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/companion/virtual/VirtualDeviceManager` for managing virtual devices.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#VPN_MANAGEMENT_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/net/VpnManager` to
manage profiles for the platform built-in VPN.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#WALLPAPER_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
com.android.server.WallpaperService for accessing wallpapers.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#WEB_APP_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/content/pm/webapp/WebAppManager`.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#WIFI_AWARE_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/net/wifi/aware/WifiAwareManager` for handling management of
Wi-Fi Aware.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#WIFI_P2P_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pManager` for handling management of
Wi-Fi peer-to-peer connections.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#WIFI_RTT_RANGING_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/net/wifi/rtt/WifiRttManager` for ranging devices with wifi.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#WIFI_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/net/wifi/WifiManager` for handling management of
Wi-Fi access.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#WINDOW_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/view/WindowManager` for accessing the system's window
manager.


From interface `https://developer.android.com/reference/android/content/ComponentCallbacks2` `int` `https://developer.android.com/reference/android/content/ComponentCallbacks2#TRIM_MEMORY_BACKGROUND`

Level for `https://developer.android.com/reference/android/content/ComponentCallbacks2#onTrimMemory(int)`: the process has gone on to the
LRU list.


`int` `https://developer.android.com/reference/android/content/ComponentCallbacks2#TRIM_MEMORY_COMPLETE`

*This constant was deprecated
in API level 35.
Apps are not notified of this level since API level 34*


`int` `https://developer.android.com/reference/android/content/ComponentCallbacks2#TRIM_MEMORY_MODERATE`

*This constant was deprecated
in API level 35.
Apps are not notified of this level since API level 34*


`int` `https://developer.android.com/reference/android/content/ComponentCallbacks2#TRIM_MEMORY_RUNNING_CRITICAL`

*This constant was deprecated
in API level 35.
Apps are not notified of this level since API level 34*


`int` `https://developer.android.com/reference/android/content/ComponentCallbacks2#TRIM_MEMORY_RUNNING_LOW`

*This constant was deprecated
in API level 35.
Apps are not notified of this level since API level 34*


`int` `https://developer.android.com/reference/android/content/ComponentCallbacks2#TRIM_MEMORY_RUNNING_MODERATE`

*This constant was deprecated
in API level 35.
Apps are not notified of this level since API level 34*


`int` `https://developer.android.com/reference/android/content/ComponentCallbacks2#TRIM_MEMORY_UI_HIDDEN`

Level for `https://developer.android.com/reference/android/content/ComponentCallbacks2#onTrimMemory(int)`: the process had been showing
a user interface, and is no longer doing so.


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

| ### Public methods ||
|---|---|
| ` boolean` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#enableHardwareAcceleration()() ` *This method was deprecated in API level 21. Starting in API 21, hardware acceleration is always enabled on capable devices* |
| ` final void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#finishConnectionlessStylusHandwriting(java.lang.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence text) ` Finishes the current connectionless stylus handwriting session and delivers the result. |
| ` final void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#finishStylusHandwriting()() ` Finish the current stylus handwriting session. |
| ` int` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#getBackDisposition()() ` Retrieves the current disposition mode that indicates the expected back button affordance. |
| ` int` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#getCandidatesHiddenVisibility()() ` Returns the visibility mode (either `https://developer.android.com/reference/android/view/View#INVISIBLE` or `https://developer.android.com/reference/android/view/View#GONE`) of the candidates view when it is not shown. |
| ` https://developer.android.com/reference/android/view/inputmethod/InputBinding` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#getCurrentInputBinding()() ` Return the currently active InputBinding for the input method, or null if there is none. |
| ` https://developer.android.com/reference/android/view/inputmethod/InputConnection` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#getCurrentInputConnection()() ` Retrieve the currently active InputConnection that is bound to the input method, or null if there is none. |
| ` https://developer.android.com/reference/android/view/inputmethod/EditorInfo` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#getCurrentInputEditorInfo()() ` |
| ` boolean` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#getCurrentInputStarted()() ` |
| ` int` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#getInputMethodWindowRecommendedHeight()() ` *This method was deprecated in API level 29. the actual behavior of this method has never been well defined. You cannot use this method in a reliable and predictable way* |
| ` https://developer.android.com/reference/android/view/LayoutInflater` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#getLayoutInflater()() ` |
| ` int` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#getMaxWidth()() ` Return the maximum width, in pixels, available the input method. |
| ` static final https://developer.android.com/reference/java/time/Duration` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#getStylusHandwritingIdleTimeoutMax()() ` Returns the maximum stylus handwriting session idle-timeout for use with `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#setStylusHandwritingSessionTimeout(java.time.Duration)`. |
| ` final https://developer.android.com/reference/java/time/Duration` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#getStylusHandwritingSessionTimeout()() ` Returns the duration after which an ongoing stylus handwriting session that hasn't received new `https://developer.android.com/reference/android/view/MotionEvent`s will time out and `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#finishStylusHandwriting()` will be called. |
| ` final https://developer.android.com/reference/android/view/Window` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#getStylusHandwritingWindow()() ` Returns the stylus handwriting inking window. |
| ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#getSystemService(java.lang.String)(https://developer.android.com/reference/java/lang/String name) ` Return the handle to a system-level service by name. |
| ` https://developer.android.com/reference/java/lang/CharSequence` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#getTextForImeAction(int)(int imeOptions) ` Return text that can be used as a button label for the given `https://developer.android.com/reference/android/view/inputmethod/EditorInfo#imeOptions`. |
| ` https://developer.android.com/reference/android/app/Dialog` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#getWindow()() ` |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#hideStatusIcon()() ` |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#hideWindow()() ` |
| ` boolean` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#isExtractViewShown()() ` Return whether the fullscreen extract view is shown. |
| ` boolean` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#isFullscreenMode()() ` Return whether the input method is *currently* running in fullscreen mode. |
| ` boolean` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#isInputViewShown()() ` Returns whether the window is currently requested to be shown. |
| ` boolean` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#isShowInputRequested()() ` Returns whether the window is currently requested to be shown with the input area *and* can currently be shown. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onAppPrivateCommand(java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/java/lang/String action, https://developer.android.com/reference/android/os/Bundle data) ` Not implemented in this class. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onBindInput()() ` Called when a new client has bound to the input method. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onComputeInsets(android.inputmethodservice.InputMethodService.Insets)(https://developer.android.com/reference/android/inputmethodservice/InputMethodService.Insets outInsets) ` Compute the interesting insets into your UI. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onConfigurationChanged(android.content.res.Configuration)(https://developer.android.com/reference/android/content/res/Configuration newConfig) ` Take care of handling configuration changes. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onConfigureWindow(android.view.Window,%20boolean,%20boolean)(https://developer.android.com/reference/android/view/Window win, boolean isFullscreen, boolean isCandidatesOnly) ` Update the given window's parameters for the given mode. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onCreate()() ` Called by the system when the service is first created. |
| ` https://developer.android.com/reference/android/view/View` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onCreateCandidatesView()() ` Create and return the view hierarchy used to show candidates. |
| ` https://developer.android.com/reference/android/view/View` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onCreateExtractTextView()() ` Called by the framework to create the layout for showing extracted text. |
| ` https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsRequest` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onCreateInlineSuggestionsRequest(android.os.Bundle)(https://developer.android.com/reference/android/os/Bundle uiExtras) ` Called when Autofill is requesting an `https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsRequest` from the IME. |
| ` https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService.AbstractInputMethodImpl` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onCreateInputMethodInterface()() ` *This method is deprecated. Overriding or calling this method is strongly discouraged. A future version of Android will remove the ability to use this method. Use the callbacks on `https://developer.android.com/reference/android/inputmethodservice/InputMethodService` as `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onBindInput()`, `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onUnbindInput()`, `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onWindowShown()`, `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onWindowHidden()`, etc.* |
| ` https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService.AbstractInputMethodSessionImpl` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onCreateInputMethodSessionInterface()() ` *This method is deprecated. Overriding or calling this method is strongly discouraged. Most methods in `https://developer.android.com/reference/android/inputmethodservice/InputMethodService.InputMethodSessionImpl` have corresponding callbacks. Use `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onFinishInput()`, `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onDisplayCompletions(android.view.inputmethod.CompletionInfo[])`, `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onUpdateExtractedText(int,%20android.view.inputmethod.ExtractedText)`, `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onUpdateSelection(int,%20int,%20int,%20int,%20int,%20int)` instead.* |
| ` https://developer.android.com/reference/android/view/View` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onCreateInputView()() ` Create and return the view hierarchy used for the input area (such as a soft keyboard). |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onCustomImeSwitcherButtonRequestedVisible(boolean)(boolean visible) ` Called when the requested visibility of a custom IME Switcher button changes. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onDestroy()() ` Called by the system to notify a Service that it is no longer used and is being removed. If you override this method you *must* call through to the superclass implementation. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onDisplayCompletions(android.view.inputmethod.CompletionInfo[])(https://developer.android.com/reference/android/view/inputmethod/CompletionInfo completions) ` Called when the application has reported auto-completion candidates that it would like to have the input method displayed. |
| ` boolean` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onEvaluateFullscreenMode()() ` Override this to control when the input method should run in fullscreen mode. |
| ` boolean` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onEvaluateInputViewShown()() ` Override this to control when the soft input area should be shown to the user. |
| ` boolean` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onExtractTextContextMenuItem(int)(int id) ` This is called when the user has selected a context menu item from the extracted text view, when running in fullscreen mode. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onExtractedCursorMovement(int,%20int)(int dx, int dy) ` This is called when the user has performed a cursor movement in the extracted text view, when it is running in fullscreen mode. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onExtractedSelectionChanged(int,%20int)(int start, int end) ` This is called when the user has moved the cursor in the extracted text view, when running in fullsreen mode. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onExtractedTextClicked()() ` This is called when the user has clicked on the extracted text view, when running in fullscreen mode. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onExtractingInputChanged(android.view.inputmethod.EditorInfo)(https://developer.android.com/reference/android/view/inputmethod/EditorInfo ei) ` This is called when, while currently displayed in extract mode, the current input target changes. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onFinishCandidatesView(boolean)(boolean finishingInput) ` Called when the candidates view is being hidden from the user. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onFinishInput()() ` Called to inform the input method that text input has finished in the last editor. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onFinishInputView(boolean)(boolean finishingInput) ` Called when the input view is being hidden from the user. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onFinishStylusHandwriting()() ` Called when the current stylus handwriting session was finished (either by the system or via `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#finishStylusHandwriting()`. |
| ` boolean` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onGenericMotionEvent(android.view.MotionEvent)(https://developer.android.com/reference/android/view/MotionEvent event) ` Override this to intercept generic motion events before they are processed by the application. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onInitializeInterface()() ` This is a hook that subclasses can use to perform initialization of their interface. |
| ` boolean` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onInlineSuggestionsResponse(android.view.inputmethod.InlineSuggestionsResponse)(https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsResponse response) ` Called when Autofill responds back with `https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsResponse` containing inline suggestions. |
| ` boolean` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onKeyDown(int,%20android.view.KeyEvent)(int keyCode, https://developer.android.com/reference/android/view/KeyEvent event) ` Called back when a `https://developer.android.com/reference/android/view/KeyEvent` is forwarded from the target application. |
| ` boolean` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onKeyLongPress(int,%20android.view.KeyEvent)(int keyCode, https://developer.android.com/reference/android/view/KeyEvent event) ` Default implementation of `https://developer.android.com/reference/android/view/KeyEvent.Callback#onKeyLongPress(int,%20android.view.KeyEvent)`: always returns false (doesn't handle the event). |
| ` boolean` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onKeyMultiple(int,%20int,%20android.view.KeyEvent)(int keyCode, int count, https://developer.android.com/reference/android/view/KeyEvent event) ` Override this to intercept special key multiple events before they are processed by the application. |
| ` boolean` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onKeyUp(int,%20android.view.KeyEvent)(int keyCode, https://developer.android.com/reference/android/view/KeyEvent event) ` Override this to intercept key up events before they are processed by the application. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onPrepareStylusHandwriting()() ` Called to prepare stylus handwriting. |
| ` boolean` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onShouldVerifyKeyEvent(android.view.KeyEvent)(https://developer.android.com/reference/android/view/KeyEvent keyEvent) ` Received by the IME before dispatching to `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onKeyDown(int,%20android.view.KeyEvent)` to determine if the `https://developer.android.com/reference/android/view/KeyEvent` requires system-level verification of its authenticity. |
| ` boolean` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onShowInputRequested(int,%20boolean)(int flags, boolean configChange) ` The system has decided that it may be time to show your input method. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onStartCandidatesView(android.view.inputmethod.EditorInfo,%20boolean)(https://developer.android.com/reference/android/view/inputmethod/EditorInfo editorInfo, boolean restarting) ` Called when only the candidates view has been shown for showing processing as the user enters text through a hard keyboard. |
| ` boolean` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onStartConnectionlessStylusHandwriting(int,%20android.view.inputmethod.CursorAnchorInfo)(int inputType, https://developer.android.com/reference/android/view/inputmethod/CursorAnchorInfo cursorAnchorInfo) ` Called when an app requests to start a connectionless stylus handwriting session using one of `https://developer.android.com/reference/android/view/inputmethod/InputMethodManager#startConnectionlessStylusHandwriting(android.view.View,%20android.view.inputmethod.CursorAnchorInfo,%20java.util.concurrent.Executor,%20android.view.inputmethod.ConnectionlessHandwritingCallback)`, `https://developer.android.com/reference/android/view/inputmethod/InputMethodManager#startConnectionlessStylusHandwritingForDelegation(android.view.View,%20android.view.inputmethod.CursorAnchorInfo,%20java.util.concurrent.Executor,%20android.view.inputmethod.ConnectionlessHandwritingCallback)`, or `https://developer.android.com/reference/android/view/inputmethod/InputMethodManager#startConnectionlessStylusHandwritingForDelegation(android.view.View,%20android.view.inputmethod.CursorAnchorInfo,%20java.lang.String,%20java.util.concurrent.Executor,%20android.view.inputmethod.ConnectionlessHandwritingCallback)`. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onStartInput(android.view.inputmethod.EditorInfo,%20boolean)(https://developer.android.com/reference/android/view/inputmethod/EditorInfo attribute, boolean restarting) ` Called to inform the input method that text input has started in an editor. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onStartInputView(android.view.inputmethod.EditorInfo,%20boolean)(https://developer.android.com/reference/android/view/inputmethod/EditorInfo editorInfo, boolean restarting) ` Called when the input view is being shown and input has started on a new editor. |
| ` boolean` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onStartStylusHandwriting()() ` Called when an app requests stylus handwriting `https://developer.android.com/reference/android/view/inputmethod/InputMethodManager#startStylusHandwriting(android.view.View)`. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onStylusHandwritingMotionEvent(android.view.MotionEvent)(https://developer.android.com/reference/android/view/MotionEvent motionEvent) ` Called after `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onStartStylusHandwriting()` returns `true` for every Stylus `https://developer.android.com/reference/android/view/MotionEvent`. |
| ` boolean` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onTrackballEvent(android.view.MotionEvent)(https://developer.android.com/reference/android/view/MotionEvent event) ` Override this to intercept trackball motion events before they are processed by the application. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onUnbindInput()() ` Called when the previous bound client is no longer associated with the input method. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onUpdateCursor(android.graphics.Rect)(https://developer.android.com/reference/android/graphics/Rect newCursor) ` *This method was deprecated in API level 21. Use `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onUpdateCursorAnchorInfo(android.view.inputmethod.CursorAnchorInfo)` instead.* |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onUpdateCursorAnchorInfo(android.view.inputmethod.CursorAnchorInfo)(https://developer.android.com/reference/android/view/inputmethod/CursorAnchorInfo cursorAnchorInfo) ` Called when the application has reported a new location of its text insertion point and characters in the composition string. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onUpdateEditorToolType(int)(int toolType) ` Called when the user tapped or clicked an editor. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onUpdateExtractedText(int,%20android.view.inputmethod.ExtractedText)(int token, https://developer.android.com/reference/android/view/inputmethod/ExtractedText text) ` Called when the application has reported new extracted text to be shown due to changes in its current text state. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onUpdateExtractingViews(android.view.inputmethod.EditorInfo)(https://developer.android.com/reference/android/view/inputmethod/EditorInfo ei) ` Called when the fullscreen-mode extracting editor info has changed, to update the state of its UI such as the action buttons shown. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onUpdateExtractingVisibility(android.view.inputmethod.EditorInfo)(https://developer.android.com/reference/android/view/inputmethod/EditorInfo ei) ` Called when the fullscreen-mode extracting editor info has changed, to determine whether the extracting (extract text and candidates) portion of the UI should be shown. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onUpdateSelection(int,%20int,%20int,%20int,%20int,%20int)(int oldSelStart, int oldSelEnd, int newSelStart, int newSelEnd, int candidatesStart, int candidatesEnd) ` Called when the application has reported a new selection region of the text. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onViewClicked(boolean)(boolean focusChanged) ` *This method was deprecated in API level 29. The method may not be called for composite `https://developer.android.com/reference/android/view/View` that works as a giant "Canvas", which can host its own UI hierarchy and sub focus state. `https://developer.android.com/reference/android/webkit/WebView` is a good example. Application / IME developers should not rely on this method. If your goal is just being notified when an on-going input is interrupted, simply monitor `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onFinishInput()`. If your goal is to know what `https://developer.android.com/reference/android/view/MotionEvent#getToolType(int)` clicked on editor, use `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onUpdateEditorToolType(int)` instead.* |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onWindowHidden()() ` Called when the input method window has been hidden from the user, after previously being visible. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onWindowShown()() ` Called immediately before the input method window is shown to the user. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#requestHideSelf(int)(int flags) ` Close this input method's soft input area, removing it from the display. |
| ` final void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#requestShowSelf(int)(int flags) ` Show the input method's soft input area, so the user sees the input method window and can interact with it. |
| ` boolean` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#sendDefaultEditorAction(boolean)(boolean fromEnterKey) ` Ask the input target to execute its default action via `https://developer.android.com/reference/android/view/inputmethod/InputConnection#performEditorAction(int)`. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#sendDownUpKeyEvents(int)(int keyEventCode) ` Send the given key event code (as defined by `https://developer.android.com/reference/android/view/KeyEvent`) to the current input connection is a key down + key up event pair. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#sendKeyChar(char)(char charCode) ` Send the given UTF-16 character to the current input connection. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#setBackDisposition(int)(int disposition) ` Sets the disposition mode that indicates the expected affordance for the back button. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#setCandidatesView(android.view.View)(https://developer.android.com/reference/android/view/View view) ` Replaces the current candidates view with a new one. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#setCandidatesViewShown(boolean)(boolean shown) ` Controls the visibility of the candidates display area. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#setExtractView(android.view.View)(https://developer.android.com/reference/android/view/View view) ` |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#setExtractViewShown(boolean)(boolean shown) ` Controls the visibility of the extracted text area. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#setInputView(android.view.View)(https://developer.android.com/reference/android/view/View view) ` Replaces the current input view with a new one. |
| ` final void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#setStylusHandwritingRegion(android.graphics.Region)(https://developer.android.com/reference/android/graphics/Region handwritingRegion) ` Sets a new stylus handwriting region as user continues to write on an editor on screen. |
| ` final void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#setStylusHandwritingSessionTimeout(java.time.Duration)(https://developer.android.com/reference/java/time/Duration duration) ` Sets the duration after which an ongoing stylus handwriting session that hasn't received new `https://developer.android.com/reference/android/view/MotionEvent`s will time out and `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#finishStylusHandwriting()` will be called. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#setTheme(int)(int theme) ` You can call this to customize the theme used by your IME's window. |
| ` final boolean` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#shouldOfferSwitchingToNextInputMethod()() ` Returns true if the current IME needs to offer the users ways to switch to a next input method (e.g. a globe key.). |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#showStatusIcon(int)(int iconResId) ` |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#showWindow(boolean)(boolean showInput) ` |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#switchInputMethod(java.lang.String)(https://developer.android.com/reference/java/lang/String id) ` Force switch to a new input method, as identified by <var translate="no">id</var>. |
| ` final void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#switchInputMethod(java.lang.String,%20android.view.inputmethod.InputMethodSubtype)(https://developer.android.com/reference/java/lang/String id, https://developer.android.com/reference/android/view/inputmethod/InputMethodSubtype subtype) ` Force switch to a new input method, as identified by `id`. |
| ` final boolean` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#switchToNextInputMethod(boolean)(boolean onlyCurrentIme) ` Force switch to the next input method and subtype. |
| ` final boolean` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#switchToPreviousInputMethod()() ` Force switch to the last used input method and subtype. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#updateFullscreenMode()() ` Re-evaluate whether the input method should be running in fullscreen mode, and update its UI if this has changed since the last time it was evaluated. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#updateInputViewShown()() ` Re-evaluate whether the soft input area should currently be shown, and update its UI if this has changed since the last time it was evaluated. |

| ### Protected methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#dump(java.io.FileDescriptor,%20java.io.PrintWriter,%20java.lang.String[])(https://developer.android.com/reference/java/io/FileDescriptor fd, https://developer.android.com/reference/java/io/PrintWriter fout, https://developer.android.com/reference/java/lang/String args) ` Performs a dump of the InputMethodService's internal state. |
| ` void` | ` https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onCurrentInputMethodSubtypeChanged(android.view.inputmethod.InputMethodSubtype)(https://developer.android.com/reference/android/view/inputmethod/InputMethodSubtype newSubtype) ` Called when the subtype was changed. |

### Inherited methods

From class `

https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService

` `


void` `
https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService#dump(java.io.FileDescriptor,%20java.io.PrintWriter,%20java.lang.String[])(https://developer.android.com/reference/java/io/FileDescriptor fd, https://developer.android.com/reference/java/io/PrintWriter fout, https://developer.android.com/reference/java/lang/String args)
`

Implement this to handle `https://developer.android.com/reference/android/os/Binder#dump(java.io.FileDescriptor,%20java.io.PrintWriter,%20java.lang.String[])`
calls on your input method.


`


https://developer.android.com/reference/android/view/KeyEvent.DispatcherState` `
https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService#getKeyDispatcherState()()
`

Return the global `https://developer.android.com/reference/android/view/KeyEvent.DispatcherState`
for used for processing events from the target application.


`


https://developer.android.com/reference/java/lang/Object` `
https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService#getSystemService(java.lang.String)(https://developer.android.com/reference/java/lang/String name)
`

Return the handle to a system-level service by name.


`


final

https://developer.android.com/reference/android/os/IBinder` `
https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService#onBind(android.content.Intent)(https://developer.android.com/reference/android/content/Intent intent)
`

Return the communication channel to the service.


`


void` `
https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService#onConfigurationChanged(android.content.res.Configuration)(https://developer.android.com/reference/android/content/res/Configuration configuration)
`

Called by the system when the device configuration changes while your
component is running.


`
abstract


https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService.AbstractInputMethodImpl` `
https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService#onCreateInputMethodInterface()()
`

Called by the framework during initialization, when the InputMethod
interface for this service needs to be created.


`
abstract


https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService.AbstractInputMethodSessionImpl` `
https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService#onCreateInputMethodSessionInterface()()
`

Called by the framework when a new InputMethodSession interface is
needed for a new client of the input method.


`


void` `
https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService#onDestroy()()
`

Called by the system to notify a Service that it is no longer used and is being removed.

If you override this method you *must* call through to the
superclass implementation.


`


boolean` `
https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService#onGenericMotionEvent(android.view.MotionEvent)(https://developer.android.com/reference/android/view/MotionEvent event)
`

Implement this to handle generic motion events on your input method.


`


void` `
https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService#onLowMemory()()
`

Override `https://developer.android.com/reference/android/app/Service`'s empty implementation and listen to `ActivityThread` for
low memory and trim memory events.


`


boolean` `
https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService#onShouldVerifyKeyEvent(android.view.KeyEvent)(https://developer.android.com/reference/android/view/KeyEvent event)
` `


boolean` `
https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService#onTrackballEvent(android.view.MotionEvent)(https://developer.android.com/reference/android/view/MotionEvent event)
`

Implement this to handle trackball events on your input method.


`


void` `
https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService#onTrimMemory(int)(int level)
`

Called when the operating system has determined that it is a good
time for a process to trim unneeded memory from its process.


`


void` `
https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService#registerComponentCallbacks(android.content.ComponentCallbacks)(https://developer.android.com/reference/android/content/ComponentCallbacks callback)
`

Here we override to prevent WindowProviderService from invoking
`https://developer.android.com/`, which will result in callback registered
for process-level Configuration change updates.


`


void` `
https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService#unregisterComponentCallbacks(android.content.ComponentCallbacks)(https://developer.android.com/reference/android/content/ComponentCallbacks callback)
`

Remove a `https://developer.android.com/reference/android/content/ComponentCallbacks` object that was previously registered
with `https://developer.android.com/reference/android/content/ContextWrapper#registerComponentCallbacks(android.content.ComponentCallbacks)`.


From class `

https://developer.android.com/reference/android/app/Service

` `


void` `
https://developer.android.com/reference/android/app/Service#attachBaseContext(android.content.Context)(https://developer.android.com/reference/android/content/Context newBase)
`

Set the base context for this ContextWrapper.


`


void` `
https://developer.android.com/reference/android/app/Service#dump(java.io.FileDescriptor,%20java.io.PrintWriter,%20java.lang.String[])(https://developer.android.com/reference/java/io/FileDescriptor fd, https://developer.android.com/reference/java/io/PrintWriter writer, https://developer.android.com/reference/java/lang/String args)
`

Print the Service's state into the given stream.


`


final

https://developer.android.com/reference/android/app/Application` `
https://developer.android.com/reference/android/app/Service#getApplication()()
`

Return the application that owns this service.


`


final

int` `
https://developer.android.com/reference/android/app/Service#getForegroundServiceType()()
`

If the service has become a foreground service by calling
`https://developer.android.com/reference/android/app/Service#startForeground(int,%20android.app.Notification)`
or `https://developer.android.com/reference/android/app/Service#startForeground(int,%20android.app.Notification,%20int)`, `https://developer.android.com/reference/android/app/Service#getForegroundServiceType()`
returns the current foreground service type.


`
abstract


https://developer.android.com/reference/android/os/IBinder` `
https://developer.android.com/reference/android/app/Service#onBind(android.content.Intent)(https://developer.android.com/reference/android/content/Intent intent)
`

Return the communication channel to the service.


`


void` `
https://developer.android.com/reference/android/app/Service#onConfigurationChanged(android.content.res.Configuration)(https://developer.android.com/reference/android/content/res/Configuration newConfig)
`

Called by the system when the device configuration changes while your
component is running.


`


void` `
https://developer.android.com/reference/android/app/Service#onCreate()()
`

Called by the system when the service is first created.


`


void` `
https://developer.android.com/reference/android/app/Service#onDestroy()()
`

Called by the system to notify a Service that it is no longer used and is being removed.


`


void` `
https://developer.android.com/reference/android/app/Service#onLowMemory()()
`

This is called when the overall system is running low on memory, and
actively running processes should trim their memory usage.


`


void` `
https://developer.android.com/reference/android/app/Service#onRebind(android.content.Intent)(https://developer.android.com/reference/android/content/Intent intent)
`

Called when new clients have connected to the service, after it had
previously been notified that all had disconnected in its
`https://developer.android.com/reference/android/app/Service#onUnbind(android.content.Intent)`.


`


void` `
https://developer.android.com/reference/android/app/Service#onStart(android.content.Intent,%20int)(https://developer.android.com/reference/android/content/Intent intent, int startId)
`

*This method was deprecated
in API level 15.
Implement `https://developer.android.com/reference/android/app/Service#onStartCommand(android.content.Intent,%20int,%20int)` instead.*


`


int` `
https://developer.android.com/reference/android/app/Service#onStartCommand(android.content.Intent,%20int,%20int)(https://developer.android.com/reference/android/content/Intent intent, int flags, int startId)
`

Called by the system every time a client explicitly starts the service by calling
`https://developer.android.com/reference/android/content/Context#startService(android.content.Intent)`, providing the arguments it supplied and a
unique integer token representing the start request.


`


void` `
https://developer.android.com/reference/android/app/Service#onTaskRemoved(android.content.Intent)(https://developer.android.com/reference/android/content/Intent rootIntent)
`

This is called if the service is currently running and the user has
removed a task that comes from the service's application.


`


void` `
https://developer.android.com/reference/android/app/Service#onTimeout(int,%20int)(int startId, int fgsType)
`

Callback called when a particular foreground service type has timed out.


`


void` `
https://developer.android.com/reference/android/app/Service#onTimeout(int)(int startId)
`

Callback called on timeout for `https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_SHORT_SERVICE`.


`


void` `
https://developer.android.com/reference/android/app/Service#onTrimMemory(int)(int level)
`

Called when the operating system has determined that it is a good
time for a process to trim unneeded memory from its process.


`


boolean` `
https://developer.android.com/reference/android/app/Service#onUnbind(android.content.Intent)(https://developer.android.com/reference/android/content/Intent intent)
`

Called when all clients have disconnected from a particular interface
published by the service.


`


final

void` `
https://developer.android.com/reference/android/app/Service#startForeground(int,%20android.app.Notification)(int id, https://developer.android.com/reference/android/app/Notification notification)
`

If your service is started (running through `https://developer.android.com/reference/android/content/Context#startService(android.content.Intent)`), then
also make this service run in the foreground, supplying the ongoing
notification to be shown to the user while in this state.


`


final

void` `
https://developer.android.com/reference/android/app/Service#startForeground(int,%20android.app.Notification,%20int)(int id, https://developer.android.com/reference/android/app/Notification notification, int foregroundServiceType)
`

An overloaded version of `https://developer.android.com/reference/android/app/Service#startForeground(int,%20android.app.Notification)` with additional
foregroundServiceType parameter.


`


final

void` `
https://developer.android.com/reference/android/app/Service#stopForeground(int)(int notificationBehavior)
`

Remove this service from foreground state, allowing it to be killed if
more memory is needed.


`


final

void` `
https://developer.android.com/reference/android/app/Service#stopForeground(boolean)(boolean removeNotification)
`

*This method was deprecated
in API level 33.
call `https://developer.android.com/reference/android/app/Service#stopForeground(int)` and pass either
`https://developer.android.com/reference/android/app/Service#STOP_FOREGROUND_REMOVE` or `https://developer.android.com/reference/android/app/Service#STOP_FOREGROUND_DETACH`
explicitly instead.*


`


final

void` `
https://developer.android.com/reference/android/app/Service#stopSelf()()
`

Stop the service, if it was previously started.


`


final

void` `
https://developer.android.com/reference/android/app/Service#stopSelf(int)(int startId)
`

Old version of `https://developer.android.com/reference/android/app/Service#stopSelfResult(int)` that doesn't return a result.


`


final

boolean` `
https://developer.android.com/reference/android/app/Service#stopSelfResult(int)(int startId)
`

Stop the service if the most recent time it was started was
<var translate="no">startId</var>.


From class `

https://developer.android.com/reference/android/content/ContextWrapper

` `


void` `
https://developer.android.com/reference/android/content/ContextWrapper#attachBaseContext(android.content.Context)(https://developer.android.com/reference/android/content/Context base)
`

Set the base context for this ContextWrapper.


`


boolean` `
https://developer.android.com/reference/android/content/ContextWrapper#bindIsolatedService(android.content.Intent,%20int,%20java.lang.String,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)(https://developer.android.com/reference/android/content/Intent service, int flags, https://developer.android.com/reference/java/lang/String instanceName, https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/content/ServiceConnection conn)
`

Variation of `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)` that, in the specific case of isolated
services, allows the caller to generate multiple instances of a service
from a single component declaration.


`


boolean` `
https://developer.android.com/reference/android/content/ContextWrapper#bindService(android.content.Intent,%20int,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)(https://developer.android.com/reference/android/content/Intent service, int flags, https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/content/ServiceConnection conn)
`

Same as `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.ServiceConnection,%20int)` with executor to control ServiceConnection
callbacks.


`


boolean` `
https://developer.android.com/reference/android/content/ContextWrapper#bindService(android.content.Intent,%20android.content.ServiceConnection,%20android.content.Context.BindServiceFlags)(https://developer.android.com/reference/android/content/Intent service, https://developer.android.com/reference/android/content/ServiceConnection conn, https://developer.android.com/reference/android/content/Context.BindServiceFlags flags)
`

See `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.ServiceConnection,%20int)`
Call `https://developer.android.com/reference/android/content/Context.BindServiceFlags#of(long)` to obtain a BindServiceFlags object.


`


boolean` `
https://developer.android.com/reference/android/content/ContextWrapper#bindService(android.content.Intent,%20android.content.ServiceConnection,%20int)(https://developer.android.com/reference/android/content/Intent service, https://developer.android.com/reference/android/content/ServiceConnection conn, int flags)
`

Connects to an application service, creating it if needed.


`


boolean` `
https://developer.android.com/reference/android/content/ContextWrapper#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)(https://developer.android.com/reference/android/content/Intent service, https://developer.android.com/reference/android/content/Context.BindServiceFlags flags, https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/content/ServiceConnection conn)
`

See `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20int,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`
Call `https://developer.android.com/reference/android/content/Context.BindServiceFlags#of(long)` to obtain a BindServiceFlags object.


`


boolean` `
https://developer.android.com/reference/android/content/ContextWrapper#bindServiceAsUser(android.content.Intent,%20android.content.ServiceConnection,%20int,%20android.os.UserHandle)(https://developer.android.com/reference/android/content/Intent service, https://developer.android.com/reference/android/content/ServiceConnection conn, int flags, https://developer.android.com/reference/android/os/UserHandle user)
`

Binds to a service in the given `user` in the same manner as `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`.


`


boolean` `
https://developer.android.com/reference/android/content/ContextWrapper#bindServiceAsUser(android.content.Intent,%20android.content.ServiceConnection,%20android.content.Context.BindServiceFlags,%20android.os.UserHandle)(https://developer.android.com/reference/android/content/Intent service, https://developer.android.com/reference/android/content/ServiceConnection conn, https://developer.android.com/reference/android/content/Context.BindServiceFlags flags, https://developer.android.com/reference/android/os/UserHandle user)
`

See `https://developer.android.com/reference/android/content/Context#bindServiceAsUser(android.content.Intent,%20android.content.ServiceConnection,%20int,%20android.os.UserHandle)`
Call `https://developer.android.com/reference/android/content/Context.BindServiceFlags#of(long)` to obtain a BindServiceFlags object.


`


int` `
https://developer.android.com/reference/android/content/ContextWrapper#checkCallingOrSelfPermission(java.lang.String)(https://developer.android.com/reference/java/lang/String permission)
`

Determine whether the calling process of an IPC *or you* have been
granted a particular permission.


`


int` `
https://developer.android.com/reference/android/content/ContextWrapper#checkCallingOrSelfUriPermission(android.net.Uri,%20int)(https://developer.android.com/reference/android/net/Uri uri, int modeFlags)
`

Determine whether the calling process of an IPC *or you* has been granted
permission to access a specific URI.


`


int[]` `
https://developer.android.com/reference/android/content/ContextWrapper#checkCallingOrSelfUriPermissions(java.util.List<android.net.Uri>,%20int)(https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/net/Uri> uris, int modeFlags)
`

Determine whether the calling process of an IPC *or you* has been granted
permission to access a list of URIs.


`


int` `
https://developer.android.com/reference/android/content/ContextWrapper#checkCallingPermission(java.lang.String)(https://developer.android.com/reference/java/lang/String permission)
`

Determine whether the calling process of an IPC you are handling has been
granted a particular permission.


`


int` `
https://developer.android.com/reference/android/content/ContextWrapper#checkCallingUriPermission(android.net.Uri,%20int)(https://developer.android.com/reference/android/net/Uri uri, int modeFlags)
`

Determine whether the calling process and uid has been
granted permission to access a specific URI.


`


int[]` `
https://developer.android.com/reference/android/content/ContextWrapper#checkCallingUriPermissions(java.util.List<android.net.Uri>,%20int)(https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/net/Uri> uris, int modeFlags)
`

Determine whether the calling process and uid has been
granted permission to access a list of URIs.


`


int` `
https://developer.android.com/reference/android/content/ContextWrapper#checkContentUriPermissionFull(android.net.Uri,%20int,%20int,%20int)(https://developer.android.com/reference/android/net/Uri uri, int pid, int uid, int modeFlags)
`

Determine whether a particular process and uid has been granted
permission to access a specific content URI.


`


int` `
https://developer.android.com/reference/android/content/ContextWrapper#checkPermission(java.lang.String,%20int,%20int)(https://developer.android.com/reference/java/lang/String permission, int pid, int uid)
`

Determine whether the given permission is allowed for a particular process and user ID
running in the system.


`


int` `
https://developer.android.com/reference/android/content/ContextWrapper#checkSelfPermission(java.lang.String)(https://developer.android.com/reference/java/lang/String permission)
`

Determine whether *you* have been granted a particular permission.


`


int` `
https://developer.android.com/reference/android/content/ContextWrapper#checkUriPermission(android.net.Uri,%20java.lang.String,%20java.lang.String,%20int,%20int,%20int)(https://developer.android.com/reference/android/net/Uri uri, https://developer.android.com/reference/java/lang/String readPermission, https://developer.android.com/reference/java/lang/String writePermission, int pid, int uid, int modeFlags)
`

Check both a Uri and normal permission.


`


int` `
https://developer.android.com/reference/android/content/ContextWrapper#checkUriPermission(android.net.Uri,%20int,%20int,%20int)(https://developer.android.com/reference/android/net/Uri uri, int pid, int uid, int modeFlags)
`

Determine whether a particular process and uid has been granted
permission to access a specific URI.


`


int[]` `
https://developer.android.com/reference/android/content/ContextWrapper#checkUriPermissions(java.util.List<android.net.Uri>,%20int,%20int,%20int)(https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/net/Uri> uris, int pid, int uid, int modeFlags)
`

Determine whether a particular process and uid has been granted
permission to access a list of URIs.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#clearWallpaper()()
`

*This method is deprecated.
Use `https://developer.android.com/reference/android/app/WallpaperManager#clear()` instead.*

*This method requires the caller to hold the permission
`https://developer.android.com/reference/android/Manifest.permission#SET_WALLPAPER`.*


`


https://developer.android.com/reference/android/content/Context` `
https://developer.android.com/reference/android/content/ContextWrapper#createAttributionContext(java.lang.String)(https://developer.android.com/reference/java/lang/String attributionTag)
`

Return a new Context object for the current Context but attribute to a different tag.


`


https://developer.android.com/reference/android/content/Context` `
https://developer.android.com/reference/android/content/ContextWrapper#createConfigurationContext(android.content.res.Configuration)(https://developer.android.com/reference/android/content/res/Configuration overrideConfiguration)
`

Return a new Context object for the current Context but whose resources
are adjusted to match the given Configuration.


`


https://developer.android.com/reference/android/content/Context` `
https://developer.android.com/reference/android/content/ContextWrapper#createContext(android.content.ContextParams)(https://developer.android.com/reference/android/content/ContextParams contextParams)
`

Creates a context with specific properties and behaviors.


`


https://developer.android.com/reference/android/content/Context` `
https://developer.android.com/reference/android/content/ContextWrapper#createContextForSplit(java.lang.String)(https://developer.android.com/reference/java/lang/String splitName)
`

Return a new Context object for the given split name.


`


https://developer.android.com/reference/android/content/Context` `
https://developer.android.com/reference/android/content/ContextWrapper#createDeviceContext(int)(int deviceId)
`

Returns a new `Context` object from the current context but with device association
given by the `deviceId`.


`


https://developer.android.com/reference/android/content/Context` `
https://developer.android.com/reference/android/content/ContextWrapper#createDeviceProtectedStorageContext()()
`

Return a new Context object for the current Context but whose storage
APIs are backed by device-protected storage.


`


https://developer.android.com/reference/android/content/Context` `
https://developer.android.com/reference/android/content/ContextWrapper#createDisplayContext(android.view.Display)(https://developer.android.com/reference/android/view/Display display)
`

Returns a new `Context` object from the current context but with resources
adjusted to match the metrics of `display`.


`


https://developer.android.com/reference/android/content/Context` `
https://developer.android.com/reference/android/content/ContextWrapper#createPackageContext(java.lang.String,%20int)(https://developer.android.com/reference/java/lang/String packageName, int flags)
`

Return a new Context object for the given application name.


`


https://developer.android.com/reference/android/content/Context` `
https://developer.android.com/reference/android/content/ContextWrapper#createWindowContext(int,%20android.os.Bundle)(int type, https://developer.android.com/reference/android/os/Bundle options)
`

Creates a Context for a non-activity window.


`


https://developer.android.com/reference/android/content/Context` `
https://developer.android.com/reference/android/content/ContextWrapper#createWindowContext(android.view.Display,%20int,%20android.os.Bundle)(https://developer.android.com/reference/android/view/Display display, int type, https://developer.android.com/reference/android/os/Bundle options)
`

Creates a `Context` for a non-`https://developer.android.com/reference/android/app/Activity` window on the given
`https://developer.android.com/reference/android/view/Display`.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/android/content/ContextWrapper#databaseList()()
`

Returns an array of strings naming the private databases associated with
this Context's application package.


`


boolean` `
https://developer.android.com/reference/android/content/ContextWrapper#deleteDatabase(java.lang.String)(https://developer.android.com/reference/java/lang/String name)
`

Delete an existing private SQLiteDatabase associated with this Context's
application package.


`


boolean` `
https://developer.android.com/reference/android/content/ContextWrapper#deleteFile(java.lang.String)(https://developer.android.com/reference/java/lang/String name)
`

Delete the given private file associated with this Context's
application package.


`


boolean` `
https://developer.android.com/reference/android/content/ContextWrapper#deleteSharedPreferences(java.lang.String)(https://developer.android.com/reference/java/lang/String name)
`

Delete an existing shared preferences file.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#enforceCallingOrSelfPermission(java.lang.String,%20java.lang.String)(https://developer.android.com/reference/java/lang/String permission, https://developer.android.com/reference/java/lang/String message)
`

If neither you nor the calling process of an IPC you are
handling has been granted a particular permission, throw a
`https://developer.android.com/reference/java/lang/SecurityException`.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#enforceCallingOrSelfUriPermission(android.net.Uri,%20int,%20java.lang.String)(https://developer.android.com/reference/android/net/Uri uri, int modeFlags, https://developer.android.com/reference/java/lang/String message)
`

If the calling process of an IPC *or you* has not been
granted permission to access a specific URI, throw `https://developer.android.com/reference/java/lang/SecurityException`.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#enforceCallingPermission(java.lang.String,%20java.lang.String)(https://developer.android.com/reference/java/lang/String permission, https://developer.android.com/reference/java/lang/String message)
`

If the calling process of an IPC you are handling has not been
granted a particular permission, throw a `https://developer.android.com/reference/java/lang/SecurityException`.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#enforceCallingUriPermission(android.net.Uri,%20int,%20java.lang.String)(https://developer.android.com/reference/android/net/Uri uri, int modeFlags, https://developer.android.com/reference/java/lang/String message)
`

If the calling process and uid has not been granted
permission to access a specific URI, throw `https://developer.android.com/reference/java/lang/SecurityException`.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#enforcePermission(java.lang.String,%20int,%20int,%20java.lang.String)(https://developer.android.com/reference/java/lang/String permission, int pid, int uid, https://developer.android.com/reference/java/lang/String message)
`

If the given permission is not allowed for a particular process
and user ID running in the system, throw a `https://developer.android.com/reference/java/lang/SecurityException`.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#enforceUriPermission(android.net.Uri,%20java.lang.String,%20java.lang.String,%20int,%20int,%20int,%20java.lang.String)(https://developer.android.com/reference/android/net/Uri uri, https://developer.android.com/reference/java/lang/String readPermission, https://developer.android.com/reference/java/lang/String writePermission, int pid, int uid, int modeFlags, https://developer.android.com/reference/java/lang/String message)
`

Enforce both a Uri and normal permission.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#enforceUriPermission(android.net.Uri,%20int,%20int,%20int,%20java.lang.String)(https://developer.android.com/reference/android/net/Uri uri, int pid, int uid, int modeFlags, https://developer.android.com/reference/java/lang/String message)
`

If a particular process and uid has not been granted
permission to access a specific URI, throw `https://developer.android.com/reference/java/lang/SecurityException`.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/android/content/ContextWrapper#fileList()()
`

Returns an array of strings naming the private files associated with
this Context's application package.


`


https://developer.android.com/reference/android/content/Context` `
https://developer.android.com/reference/android/content/ContextWrapper#getApplicationContext()()
`

Return the context of the single, global Application object of the
current process.


`


https://developer.android.com/reference/android/content/pm/ApplicationInfo` `
https://developer.android.com/reference/android/content/ContextWrapper#getApplicationInfo()()
`

Return the full application info for this context's package.


`


https://developer.android.com/reference/android/content/res/AssetManager` `
https://developer.android.com/reference/android/content/ContextWrapper#getAssets()()
`

Returns an AssetManager instance for the application's package.


`


https://developer.android.com/reference/android/content/AttributionSource` `
https://developer.android.com/reference/android/content/ContextWrapper#getAttributionSource()()
`


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/android/content/ContextWrapper#getAttributionTag()()
`

<br />

Attribution can be used in complex apps to logically separate parts of the app.


`


https://developer.android.com/reference/android/content/Context` `
https://developer.android.com/reference/android/content/ContextWrapper#getBaseContext()()
` `


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/ContextWrapper#getCacheDir()()
`

Returns the absolute path to the application specific cache directory on
the filesystem.


`


https://developer.android.com/reference/java/lang/ClassLoader` `
https://developer.android.com/reference/android/content/ContextWrapper#getClassLoader()()
`

Return a class loader you can use to retrieve classes in this package.


`


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/ContextWrapper#getCodeCacheDir()()
`

Returns the absolute path to the application specific cache directory on
the filesystem designed for storing cached code.


`


https://developer.android.com/reference/android/content/ContentResolver` `
https://developer.android.com/reference/android/content/ContextWrapper#getContentResolver()()
`

Return a ContentResolver instance for your application's package.


`


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/ContextWrapper#getDataDir()()
`

Returns the absolute path to the directory on the filesystem where all
private files belonging to this app are stored.


`


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/ContextWrapper#getDatabasePath(java.lang.String)(https://developer.android.com/reference/java/lang/String name)
`

Returns the absolute path on the filesystem where a database created with
`https://developer.android.com/reference/android/content/Context#openOrCreateDatabase(java.lang.String,%20int,%20android.database.sqlite.SQLiteDatabase.CursorFactory)` is stored.


`


int` `
https://developer.android.com/reference/android/content/ContextWrapper#getDeviceId()()
`

Gets the device ID this context is associated with.


`


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/ContextWrapper#getDir(java.lang.String,%20int)(https://developer.android.com/reference/java/lang/String name, int mode)
`

Retrieve, creating if needed, a new directory in which the application
can place its own custom data files.


`


https://developer.android.com/reference/android/view/Display` `
https://developer.android.com/reference/android/content/ContextWrapper#getDisplay()()
`

Get the display this context is associated with.


`


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/ContextWrapper#getExternalCacheDir()()
`

Returns absolute path to application-specific directory on the primary
shared/external storage device where the application can place cache
files it owns.


`


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/ContextWrapper#getExternalCacheDirs()()
`

Returns absolute paths to application-specific directories on all
shared/external storage devices where the application can place cache
files it owns.


`


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/ContextWrapper#getExternalFilesDir(java.lang.String)(https://developer.android.com/reference/java/lang/String type)
`

Returns the absolute path to the directory on the primary shared/external
storage device where the application can place persistent files it owns.


`


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/ContextWrapper#getExternalFilesDirs(java.lang.String)(https://developer.android.com/reference/java/lang/String type)
`

Returns absolute paths to application-specific directories on all
shared/external storage devices where the application can place
persistent files it owns.


`


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/ContextWrapper#getExternalMediaDirs()()
`

*This method is deprecated.
These directories still exist and are scanned, but developers
are encouraged to migrate to inserting content into a
`https://developer.android.com/reference/android/provider/MediaStore` collection directly, as any app can
contribute new media to `https://developer.android.com/reference/android/provider/MediaStore` with no
permissions required, starting in
`https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q`.*


`


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/ContextWrapper#getFileStreamPath(java.lang.String)(https://developer.android.com/reference/java/lang/String name)
`

Returns the absolute path on the filesystem where a file created with
`https://developer.android.com/reference/android/content/Context#openFileOutput(java.lang.String,%20int)` is stored.


`


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/ContextWrapper#getFilesDir()()
`

Returns the absolute path to the directory on the filesystem where files
created with `https://developer.android.com/reference/android/content/Context#openFileOutput(java.lang.String,%20int)` are stored.


`


https://developer.android.com/reference/java/util/concurrent/Executor` `
https://developer.android.com/reference/android/content/ContextWrapper#getMainExecutor()()
`

Return an `https://developer.android.com/reference/java/util/concurrent/Executor` that will run enqueued tasks on the main
thread associated with this context.


`


https://developer.android.com/reference/android/os/Looper` `
https://developer.android.com/reference/android/content/ContextWrapper#getMainLooper()()
`

Return the Looper for the main thread of the current process.


`


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/ContextWrapper#getNoBackupFilesDir()()
`

Returns the absolute path to the directory on the filesystem similar to
`https://developer.android.com/reference/android/content/Context#getFilesDir()`.


`


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/ContextWrapper#getObbDir()()
`

Return the primary shared/external storage directory where this
application's OBB files (if there are any) can be found.


`


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/ContextWrapper#getObbDirs()()
`

Returns absolute paths to application-specific directories on all
shared/external storage devices where the application's OBB files (if
there are any) can be found.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/android/content/ContextWrapper#getOpPackageName()()
`

Return the package name that should be used for `https://developer.android.com/reference/android/app/AppOpsManager` calls from
this context, so that app ops manager's uid verification will work with the name.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/android/content/ContextWrapper#getPackageCodePath()()
`

Return the full path to this context's primary Android package.


`


https://developer.android.com/reference/android/content/pm/PackageManager` `
https://developer.android.com/reference/android/content/ContextWrapper#getPackageManager()()
`

Return PackageManager instance to find global package information.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/android/content/ContextWrapper#getPackageName()()
`

Return the name of this application's package.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/android/content/ContextWrapper#getPackageResourcePath()()
`

Return the full path to this context's primary Android package.


`


https://developer.android.com/reference/android/content/ContextParams` `
https://developer.android.com/reference/android/content/ContextWrapper#getParams()()
`

Return the set of parameters which this Context was created with, if it
was created via `https://developer.android.com/reference/android/content/Context#createContext(android.content.ContextParams)`.


`


https://developer.android.com/reference/android/content/res/Resources` `
https://developer.android.com/reference/android/content/ContextWrapper#getResources()()
`

Returns a Resources instance for the application's package.


`


https://developer.android.com/reference/android/content/SharedPreferences` `
https://developer.android.com/reference/android/content/ContextWrapper#getSharedPreferences(java.lang.String,%20int)(https://developer.android.com/reference/java/lang/String name, int mode)
`

Retrieve and hold the contents of the preferences file 'name', returning
a SharedPreferences through which you can retrieve and modify its
values.


`


https://developer.android.com/reference/java/lang/Object` `
https://developer.android.com/reference/android/content/ContextWrapper#getSystemService(java.lang.String)(https://developer.android.com/reference/java/lang/String name)
`

Return the handle to a system-level service by name.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/android/content/ContextWrapper#getSystemServiceName(java.lang.Class<?>)(https://developer.android.com/reference/java/lang/Class<?> serviceClass)
`

Gets the name of the system-level service that is represented by the specified class.


`


https://developer.android.com/reference/android/content/res/Resources.Theme` `
https://developer.android.com/reference/android/content/ContextWrapper#getTheme()()
`

Return the Theme object associated with this Context.


`


https://developer.android.com/reference/android/graphics/drawable/Drawable` `
https://developer.android.com/reference/android/content/ContextWrapper#getWallpaper()()
`

*This method is deprecated.
Use `https://developer.android.com/reference/android/app/WallpaperManager#getDrawable()` instead.*


`


int` `
https://developer.android.com/reference/android/content/ContextWrapper#getWallpaperDesiredMinimumHeight()()
`

*This method is deprecated.
Use `https://developer.android.com/reference/android/app/WallpaperManager#getDesiredMinimumHeight()` instead.*


`


int` `
https://developer.android.com/reference/android/content/ContextWrapper#getWallpaperDesiredMinimumWidth()()
`

*This method is deprecated.
Use `https://developer.android.com/reference/android/app/WallpaperManager#getDesiredMinimumWidth()` instead.*


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#grantUriPermission(java.lang.String,%20android.net.Uri,%20int)(https://developer.android.com/reference/java/lang/String toPackage, https://developer.android.com/reference/android/net/Uri uri, int modeFlags)
`

Grant permission to access a specific Uri to another package, regardless
of whether that package has general permission to access the Uri's
content provider.


`


boolean` `
https://developer.android.com/reference/android/content/ContextWrapper#isDeviceProtectedStorage()()
`

Indicates if the storage APIs of this Context are backed by
device-protected storage.


`


boolean` `
https://developer.android.com/reference/android/content/ContextWrapper#isRestricted()()
`

Indicates whether this Context is restricted.


`


boolean` `
https://developer.android.com/reference/android/content/ContextWrapper#isUiContext()()
`

Returns `true` if the context is a UI context which can access UI components such as
`https://developer.android.com/reference/android/view/WindowManager`, `https://developer.android.com/reference/android/view/LayoutInflater` or
`https://developer.android.com/reference/android/app/WallpaperManager`.


`


boolean` `
https://developer.android.com/reference/android/content/ContextWrapper#moveDatabaseFrom(android.content.Context,%20java.lang.String)(https://developer.android.com/reference/android/content/Context sourceContext, https://developer.android.com/reference/java/lang/String name)
`

Move an existing database file from the given source storage context to
this context.


`


boolean` `
https://developer.android.com/reference/android/content/ContextWrapper#moveSharedPreferencesFrom(android.content.Context,%20java.lang.String)(https://developer.android.com/reference/android/content/Context sourceContext, https://developer.android.com/reference/java/lang/String name)
`

Move an existing shared preferences file from the given source storage
context to this context.


`


https://developer.android.com/reference/java/io/FileInputStream` `
https://developer.android.com/reference/android/content/ContextWrapper#openFileInput(java.lang.String)(https://developer.android.com/reference/java/lang/String name)
`

Open a private file associated with this Context's application package
for reading.


`


https://developer.android.com/reference/java/io/FileOutputStream` `
https://developer.android.com/reference/android/content/ContextWrapper#openFileOutput(java.lang.String,%20int)(https://developer.android.com/reference/java/lang/String name, int mode)
`

Open a private file associated with this Context's application package
for writing.


`


https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase` `
https://developer.android.com/reference/android/content/ContextWrapper#openOrCreateDatabase(java.lang.String,%20int,%20android.database.sqlite.SQLiteDatabase.CursorFactory,%20android.database.DatabaseErrorHandler)(https://developer.android.com/reference/java/lang/String name, int mode, https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.CursorFactory factory, https://developer.android.com/reference/android/database/DatabaseErrorHandler errorHandler)
`

Open a new private SQLiteDatabase associated with this Context's
application package.


`


https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase` `
https://developer.android.com/reference/android/content/ContextWrapper#openOrCreateDatabase(java.lang.String,%20int,%20android.database.sqlite.SQLiteDatabase.CursorFactory)(https://developer.android.com/reference/java/lang/String name, int mode, https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.CursorFactory factory)
`

Open a new private SQLiteDatabase associated with this Context's
application package.


`


https://developer.android.com/reference/android/graphics/drawable/Drawable` `
https://developer.android.com/reference/android/content/ContextWrapper#peekWallpaper()()
`

*This method is deprecated.
Use `https://developer.android.com/reference/android/app/WallpaperManager#peekDrawable()` instead.*


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#rebindService(android.content.ServiceConnection,%20android.content.Context.BindServiceFlags)(https://developer.android.com/reference/android/content/ServiceConnection conn, https://developer.android.com/reference/android/content/Context.BindServiceFlags flags)
`

Rebind an application service with updated bind service flags


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#registerComponentCallbacks(android.content.ComponentCallbacks)(https://developer.android.com/reference/android/content/ComponentCallbacks callback)
`

Add a new `https://developer.android.com/reference/android/content/ComponentCallbacks` to the base application of the
Context, which will be called at the same times as the ComponentCallbacks
methods of activities and other components are called.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#registerDeviceIdChangeListener(java.util.concurrent.Executor,%20java.util.function.IntConsumer)(https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/java/util/function/IntConsumer listener)
`

Adds a new device ID changed listener to the `Context`, which will be called when
the device association is changed by the system.


`


https://developer.android.com/reference/android/content/Intent` `
https://developer.android.com/reference/android/content/ContextWrapper#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter)(https://developer.android.com/reference/android/content/BroadcastReceiver receiver, https://developer.android.com/reference/android/content/IntentFilter filter)
`

Register a BroadcastReceiver to be run in the main activity thread.


`


https://developer.android.com/reference/android/content/Intent` `
https://developer.android.com/reference/android/content/ContextWrapper#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter,%20int)(https://developer.android.com/reference/android/content/BroadcastReceiver receiver, https://developer.android.com/reference/android/content/IntentFilter filter, int flags)
`

Register to receive intent broadcasts, with the receiver optionally being
exposed to Instant Apps.


`


https://developer.android.com/reference/android/content/Intent` `
https://developer.android.com/reference/android/content/ContextWrapper#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter,%20java.lang.String,%20android.os.Handler,%20int)(https://developer.android.com/reference/android/content/BroadcastReceiver receiver, https://developer.android.com/reference/android/content/IntentFilter filter, https://developer.android.com/reference/java/lang/String broadcastPermission, https://developer.android.com/reference/android/os/Handler scheduler, int flags)
`

Register to receive intent broadcasts, to run in the context of
<var translate="no">scheduler</var>.


`


https://developer.android.com/reference/android/content/Intent` `
https://developer.android.com/reference/android/content/ContextWrapper#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter,%20java.lang.String,%20android.os.Handler)(https://developer.android.com/reference/android/content/BroadcastReceiver receiver, https://developer.android.com/reference/android/content/IntentFilter filter, https://developer.android.com/reference/java/lang/String broadcastPermission, https://developer.android.com/reference/android/os/Handler scheduler)
`

Register to receive intent broadcasts, to run in the context of
<var translate="no">scheduler</var>.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#removeStickyBroadcast(android.content.Intent)(https://developer.android.com/reference/android/content/Intent intent)
`

*This method is deprecated.
Sticky broadcasts should not be used. They provide no security (anyone
can access them), no protection (anyone can modify them), and many other problems.
The recommended pattern is to use a non-sticky broadcast to report that *something*
has changed, with another mechanism for apps to retrieve the current value whenever
desired.*


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#removeStickyBroadcastAsUser(android.content.Intent,%20android.os.UserHandle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/os/UserHandle user)
`

*This method is deprecated.
Sticky broadcasts should not be used. They provide no security (anyone
can access them), no protection (anyone can modify them), and many other problems.
The recommended pattern is to use a non-sticky broadcast to report that *something*
has changed, with another mechanism for apps to retrieve the current value whenever
desired.*


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#revokeSelfPermissionsOnKill(java.util.Collection<java.lang.String>)(https://developer.android.com/reference/java/util/Collection<https://developer.android.com/reference/java/lang/String> permissions)
`

Triggers the revocation of one or more permissions for the calling package.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#revokeUriPermission(android.net.Uri,%20int)(https://developer.android.com/reference/android/net/Uri uri, int modeFlags)
`

Remove all permissions to access a particular content provider Uri
that were previously added with `https://developer.android.com/reference/android/content/Context#grantUriPermission(java.lang.String,%20android.net.Uri,%20int)` or *any other* mechanism.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#revokeUriPermission(java.lang.String,%20android.net.Uri,%20int)(https://developer.android.com/reference/java/lang/String targetPackage, https://developer.android.com/reference/android/net/Uri uri, int modeFlags)
`

Remove permissions to access a particular content provider Uri
that were previously added with `https://developer.android.com/reference/android/content/Context#grantUriPermission(java.lang.String,%20android.net.Uri,%20int)` for a specific target
package.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#sendBroadcast(android.content.Intent,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/java/lang/String receiverPermission, https://developer.android.com/reference/android/os/Bundle options)
`

Broadcast the given intent to all interested BroadcastReceivers, allowing
an optional required permission to be enforced.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#sendBroadcast(android.content.Intent,%20java.lang.String)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/java/lang/String receiverPermission)
`

Broadcast the given intent to all interested BroadcastReceivers, allowing
an optional required permission to be enforced.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#sendBroadcast(android.content.Intent)(https://developer.android.com/reference/android/content/Intent intent)
`

Broadcast the given intent to all interested BroadcastReceivers.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#sendBroadcastAsUser(android.content.Intent,%20android.os.UserHandle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/os/UserHandle user)
`

Version of `https://developer.android.com/reference/android/content/Context#sendBroadcast(android.content.Intent)` that allows you to specify the
user the broadcast will be sent to.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#sendBroadcastAsUser(android.content.Intent,%20android.os.UserHandle,%20java.lang.String)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/os/UserHandle user, https://developer.android.com/reference/java/lang/String receiverPermission)
`

Version of `https://developer.android.com/reference/android/content/Context#sendBroadcast(android.content.Intent,%20java.lang.String)` that allows you to specify the
user the broadcast will be sent to.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#sendOrderedBroadcast(android.content.Intent,%20java.lang.String,%20java.lang.String,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/java/lang/String receiverPermission, https://developer.android.com/reference/java/lang/String receiverAppOp, https://developer.android.com/reference/android/content/BroadcastReceiver resultReceiver, https://developer.android.com/reference/android/os/Handler scheduler, int initialCode, https://developer.android.com/reference/java/lang/String initialData, https://developer.android.com/reference/android/os/Bundle initialExtras)
`

Version of
`https://developer.android.com/reference/android/content/Context#sendOrderedBroadcast(android.content.Intent,%20java.lang.String,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)` that allows you to specify the App Op to enforce restrictions on which receivers
the broadcast will be sent to.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#sendOrderedBroadcast(android.content.Intent,%20int,%20java.lang.String,%20java.lang.String,%20android.content.BroadcastReceiver,%20android.os.Handler,%20java.lang.String,%20android.os.Bundle,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, int initialCode, https://developer.android.com/reference/java/lang/String receiverPermission, https://developer.android.com/reference/java/lang/String receiverAppOp, https://developer.android.com/reference/android/content/BroadcastReceiver resultReceiver, https://developer.android.com/reference/android/os/Handler scheduler, https://developer.android.com/reference/java/lang/String initialData, https://developer.android.com/reference/android/os/Bundle initialExtras, https://developer.android.com/reference/android/os/Bundle options)
`


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#sendOrderedBroadcast(android.content.Intent,%20java.lang.String,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/java/lang/String receiverPermission, https://developer.android.com/reference/android/content/BroadcastReceiver resultReceiver, https://developer.android.com/reference/android/os/Handler scheduler, int initialCode, https://developer.android.com/reference/java/lang/String initialData, https://developer.android.com/reference/android/os/Bundle initialExtras)
`

Version of `https://developer.android.com/reference/android/content/Context#sendBroadcast(android.content.Intent)` that allows you to
receive data back from the broadcast.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#sendOrderedBroadcast(android.content.Intent,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/java/lang/String receiverPermission, https://developer.android.com/reference/android/os/Bundle options)
`

Broadcast the given intent to all interested BroadcastReceivers, delivering
them one at a time to allow more preferred receivers to consume the
broadcast before it is delivered to less preferred receivers.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#sendOrderedBroadcast(android.content.Intent,%20java.lang.String,%20android.os.Bundle,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/java/lang/String receiverPermission, https://developer.android.com/reference/android/os/Bundle options, https://developer.android.com/reference/android/content/BroadcastReceiver resultReceiver, https://developer.android.com/reference/android/os/Handler scheduler, int initialCode, https://developer.android.com/reference/java/lang/String initialData, https://developer.android.com/reference/android/os/Bundle initialExtras)
`

Version of `https://developer.android.com/reference/android/content/Context#sendBroadcast(android.content.Intent)` that allows you to
receive data back from the broadcast.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#sendOrderedBroadcast(android.content.Intent,%20java.lang.String)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/java/lang/String receiverPermission)
`

Broadcast the given intent to all interested BroadcastReceivers, delivering
them one at a time to allow more preferred receivers to consume the
broadcast before it is delivered to less preferred receivers.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#sendOrderedBroadcastAsUser(android.content.Intent,%20android.os.UserHandle,%20java.lang.String,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/os/UserHandle user, https://developer.android.com/reference/java/lang/String receiverPermission, https://developer.android.com/reference/android/content/BroadcastReceiver resultReceiver, https://developer.android.com/reference/android/os/Handler scheduler, int initialCode, https://developer.android.com/reference/java/lang/String initialData, https://developer.android.com/reference/android/os/Bundle initialExtras)
`

Version of
`https://developer.android.com/reference/android/content/Context#sendOrderedBroadcast(android.content.Intent,%20java.lang.String,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)`
that allows you to specify the
user the broadcast will be sent to.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#sendStickyBroadcast(android.content.Intent)(https://developer.android.com/reference/android/content/Intent intent)
`

*This method is deprecated.
Sticky broadcasts should not be used. They provide no security (anyone
can access them), no protection (anyone can modify them), and many other problems.
The recommended pattern is to use a non-sticky broadcast to report that *something*
has changed, with another mechanism for apps to retrieve the current value whenever
desired.*


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#sendStickyBroadcast(android.content.Intent,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/os/Bundle options)
`

*This method is deprecated.
Sticky broadcasts should not be used. They provide no security (anyone
can access them), no protection (anyone can modify them), and many other problems.
The recommended pattern is to use a non-sticky broadcast to report that *something*
has changed, with another mechanism for apps to retrieve the current value whenever
desired.*


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#sendStickyBroadcastAsUser(android.content.Intent,%20android.os.UserHandle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/os/UserHandle user)
`

*This method is deprecated.
Sticky broadcasts should not be used. They provide no security (anyone
can access them), no protection (anyone can modify them), and many other problems.
The recommended pattern is to use a non-sticky broadcast to report that *something*
has changed, with another mechanism for apps to retrieve the current value whenever
desired.*


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#sendStickyOrderedBroadcast(android.content.Intent,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/content/BroadcastReceiver resultReceiver, https://developer.android.com/reference/android/os/Handler scheduler, int initialCode, https://developer.android.com/reference/java/lang/String initialData, https://developer.android.com/reference/android/os/Bundle initialExtras)
`

*This method is deprecated.
Sticky broadcasts should not be used. They provide no security (anyone
can access them), no protection (anyone can modify them), and many other problems.
The recommended pattern is to use a non-sticky broadcast to report that *something*
has changed, with another mechanism for apps to retrieve the current value whenever
desired.*


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#sendStickyOrderedBroadcastAsUser(android.content.Intent,%20android.os.UserHandle,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/os/UserHandle user, https://developer.android.com/reference/android/content/BroadcastReceiver resultReceiver, https://developer.android.com/reference/android/os/Handler scheduler, int initialCode, https://developer.android.com/reference/java/lang/String initialData, https://developer.android.com/reference/android/os/Bundle initialExtras)
`

*This method is deprecated.
Sticky broadcasts should not be used. They provide no security (anyone
can access them), no protection (anyone can modify them), and many other problems.
The recommended pattern is to use a non-sticky broadcast to report that *something*
has changed, with another mechanism for apps to retrieve the current value whenever
desired.*


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#setTheme(int)(int resid)
`

Set the base theme for this context.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#setWallpaper(android.graphics.Bitmap)(https://developer.android.com/reference/android/graphics/Bitmap bitmap)
`

*This method is deprecated.
Use `https://developer.android.com/reference/android/app/WallpaperManager#setBitmap(android.graphics.Bitmap)` instead.*

*This method requires the caller to hold the permission
`https://developer.android.com/reference/android/Manifest.permission#SET_WALLPAPER`.*


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#setWallpaper(java.io.InputStream)(https://developer.android.com/reference/java/io/InputStream data)
`

*This method is deprecated.
Use `https://developer.android.com/reference/android/app/WallpaperManager#setStream(java.io.InputStream)` instead.*

*This method requires the caller to hold the permission
`https://developer.android.com/reference/android/Manifest.permission#SET_WALLPAPER`.*


`


boolean` `
https://developer.android.com/reference/android/content/ContextWrapper#shouldShowRequestPermissionRationale(java.lang.String)(https://developer.android.com/reference/java/lang/String permission)
`

Gets whether you should show UI with rationale before requesting a permission.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#startActivities(android.content.Intent[],%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intents, https://developer.android.com/reference/android/os/Bundle options)
`

Launch multiple new activities.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#startActivities(android.content.Intent[])(https://developer.android.com/reference/android/content/Intent intents)
`

Same as `https://developer.android.com/reference/android/content/Context#startActivities(android.content.Intent[],%20android.os.Bundle)` with no options
specified.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#startActivity(android.content.Intent)(https://developer.android.com/reference/android/content/Intent intent)
`

Same as `https://developer.android.com/reference/android/content/Context#startActivity(android.content.Intent,%20android.os.Bundle)` with no options
specified.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#startActivity(android.content.Intent,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/os/Bundle options)
`

Launch a new activity.


`


https://developer.android.com/reference/android/content/ComponentName` `
https://developer.android.com/reference/android/content/ContextWrapper#startForegroundService(android.content.Intent)(https://developer.android.com/reference/android/content/Intent service)
`

Similar to `https://developer.android.com/reference/android/content/Context#startService(android.content.Intent)`, but with an implicit promise that the
Service will call `https://developer.android.com/reference/android/app/Service#startForeground(int,%20android.app.Notification)` once it begins running.


`


boolean` `
https://developer.android.com/reference/android/content/ContextWrapper#startInstrumentation(android.content.ComponentName,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/ComponentName className, https://developer.android.com/reference/java/lang/String profileFile, https://developer.android.com/reference/android/os/Bundle arguments)
`

Start executing an `https://developer.android.com/reference/android/app/Instrumentation` class.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#startIntentSender(android.content.IntentSender,%20android.content.Intent,%20int,%20int,%20int)(https://developer.android.com/reference/android/content/IntentSender intent, https://developer.android.com/reference/android/content/Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags)
`

Same as `https://developer.android.com/reference/android/content/Context#startIntentSender(android.content.IntentSender,%20android.content.Intent,%20int,%20int,%20int,%20android.os.Bundle)`
with no options specified.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#startIntentSender(android.content.IntentSender,%20android.content.Intent,%20int,%20int,%20int,%20android.os.Bundle)(https://developer.android.com/reference/android/content/IntentSender intent, https://developer.android.com/reference/android/content/Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags, https://developer.android.com/reference/android/os/Bundle options)
`

Like `https://developer.android.com/reference/android/content/Context#startActivity(android.content.Intent,%20android.os.Bundle)`, but taking a IntentSender
to start.


`


https://developer.android.com/reference/android/content/ComponentName` `
https://developer.android.com/reference/android/content/ContextWrapper#startService(android.content.Intent)(https://developer.android.com/reference/android/content/Intent service)
`

Request that a given application service be started.


`


boolean` `
https://developer.android.com/reference/android/content/ContextWrapper#stopService(android.content.Intent)(https://developer.android.com/reference/android/content/Intent name)
`

Request that a given application service be stopped.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#unbindService(android.content.ServiceConnection)(https://developer.android.com/reference/android/content/ServiceConnection conn)
`

Disconnect from an application service.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#unregisterComponentCallbacks(android.content.ComponentCallbacks)(https://developer.android.com/reference/android/content/ComponentCallbacks callback)
`

Remove a `https://developer.android.com/reference/android/content/ComponentCallbacks` object that was previously registered
with `https://developer.android.com/reference/android/content/ContextWrapper#registerComponentCallbacks(android.content.ComponentCallbacks)`.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#unregisterDeviceIdChangeListener(java.util.function.IntConsumer)(https://developer.android.com/reference/java/util/function/IntConsumer listener)
`

Removes a device ID changed listener from the Context.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#unregisterReceiver(android.content.BroadcastReceiver)(https://developer.android.com/reference/android/content/BroadcastReceiver receiver)
`

Unregister a previously registered BroadcastReceiver.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#updateServiceBindings(java.util.Collection<android.content.Context.UpdateBindingParams>)(https://developer.android.com/reference/java/util/Collection<https://developer.android.com/reference/android/content/Context.UpdateBindingParams> params)
`

Perform a batch update of existing bindings.


`


void` `
https://developer.android.com/reference/android/content/ContextWrapper#updateServiceGroup(android.content.ServiceConnection,%20int,%20int)(https://developer.android.com/reference/android/content/ServiceConnection conn, int group, int importance)
`

For a service previously bound with `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)` or a related method, change
how the system manages that service's process in relation to other processes.


From class `

https://developer.android.com/reference/android/content/Context

` `


boolean` `
https://developer.android.com/reference/android/content/Context#bindIsolatedService(android.content.Intent,%20int,%20java.lang.String,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)(https://developer.android.com/reference/android/content/Intent service, int flags, https://developer.android.com/reference/java/lang/String instanceName, https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/content/ServiceConnection conn)
`

Variation of `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)` that, in the specific case of isolated
services, allows the caller to generate multiple instances of a service
from a single component declaration.


`


boolean` `
https://developer.android.com/reference/android/content/Context#bindIsolatedService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.lang.String,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)(https://developer.android.com/reference/android/content/Intent service, https://developer.android.com/reference/android/content/Context.BindServiceFlags flags, https://developer.android.com/reference/java/lang/String instanceName, https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/content/ServiceConnection conn)
`

See `https://developer.android.com/reference/android/content/Context#bindIsolatedService(android.content.Intent,%20int,%20java.lang.String,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`
Call `https://developer.android.com/reference/android/content/Context.BindServiceFlags#of(long)` to obtain a BindServiceFlags object.


`


boolean` `
https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20int,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)(https://developer.android.com/reference/android/content/Intent service, int flags, https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/content/ServiceConnection conn)
`

Same as `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.ServiceConnection,%20int)` with executor to control ServiceConnection
callbacks.


`


boolean` `
https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.ServiceConnection,%20android.content.Context.BindServiceFlags)(https://developer.android.com/reference/android/content/Intent service, https://developer.android.com/reference/android/content/ServiceConnection conn, https://developer.android.com/reference/android/content/Context.BindServiceFlags flags)
`

See `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.ServiceConnection,%20int)`
Call `https://developer.android.com/reference/android/content/Context.BindServiceFlags#of(long)` to obtain a BindServiceFlags object.


`
abstract


boolean` `
https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.ServiceConnection,%20int)(https://developer.android.com/reference/android/content/Intent service, https://developer.android.com/reference/android/content/ServiceConnection conn, int flags)
`

Connects to an application service, creating it if needed.


`


boolean` `
https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)(https://developer.android.com/reference/android/content/Intent service, https://developer.android.com/reference/android/content/Context.BindServiceFlags flags, https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/content/ServiceConnection conn)
`

See `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20int,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`
Call `https://developer.android.com/reference/android/content/Context.BindServiceFlags#of(long)` to obtain a BindServiceFlags object.


`


boolean` `
https://developer.android.com/reference/android/content/Context#bindServiceAsUser(android.content.Intent,%20android.content.ServiceConnection,%20int,%20android.os.UserHandle)(https://developer.android.com/reference/android/content/Intent service, https://developer.android.com/reference/android/content/ServiceConnection conn, int flags, https://developer.android.com/reference/android/os/UserHandle user)
`

Binds to a service in the given `user` in the same manner as `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`.


`


boolean` `
https://developer.android.com/reference/android/content/Context#bindServiceAsUser(android.content.Intent,%20android.content.ServiceConnection,%20android.content.Context.BindServiceFlags,%20android.os.UserHandle)(https://developer.android.com/reference/android/content/Intent service, https://developer.android.com/reference/android/content/ServiceConnection conn, https://developer.android.com/reference/android/content/Context.BindServiceFlags flags, https://developer.android.com/reference/android/os/UserHandle user)
`

See `https://developer.android.com/reference/android/content/Context#bindServiceAsUser(android.content.Intent,%20android.content.ServiceConnection,%20int,%20android.os.UserHandle)`
Call `https://developer.android.com/reference/android/content/Context.BindServiceFlags#of(long)` to obtain a BindServiceFlags object.


`
abstract


int` `
https://developer.android.com/reference/android/content/Context#checkCallingOrSelfPermission(java.lang.String)(https://developer.android.com/reference/java/lang/String permission)
`

Determine whether the calling process of an IPC *or you* have been
granted a particular permission.


`
abstract


int` `
https://developer.android.com/reference/android/content/Context#checkCallingOrSelfUriPermission(android.net.Uri,%20int)(https://developer.android.com/reference/android/net/Uri uri, int modeFlags)
`

Determine whether the calling process of an IPC *or you* has been granted
permission to access a specific URI.


`


int[]` `
https://developer.android.com/reference/android/content/Context#checkCallingOrSelfUriPermissions(java.util.List<android.net.Uri>,%20int)(https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/net/Uri> uris, int modeFlags)
`

Determine whether the calling process of an IPC *or you* has been granted
permission to access a list of URIs.


`
abstract


int` `
https://developer.android.com/reference/android/content/Context#checkCallingPermission(java.lang.String)(https://developer.android.com/reference/java/lang/String permission)
`

Determine whether the calling process of an IPC you are handling has been
granted a particular permission.


`
abstract


int` `
https://developer.android.com/reference/android/content/Context#checkCallingUriPermission(android.net.Uri,%20int)(https://developer.android.com/reference/android/net/Uri uri, int modeFlags)
`

Determine whether the calling process and uid has been
granted permission to access a specific URI.


`


int[]` `
https://developer.android.com/reference/android/content/Context#checkCallingUriPermissions(java.util.List<android.net.Uri>,%20int)(https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/net/Uri> uris, int modeFlags)
`

Determine whether the calling process and uid has been
granted permission to access a list of URIs.


`


int` `
https://developer.android.com/reference/android/content/Context#checkContentUriPermissionFull(android.net.Uri,%20int,%20int,%20int)(https://developer.android.com/reference/android/net/Uri uri, int pid, int uid, int modeFlags)
`

Determine whether a particular process and uid has been granted
permission to access a specific content URI.


`
abstract


int` `
https://developer.android.com/reference/android/content/Context#checkPermission(java.lang.String,%20int,%20int)(https://developer.android.com/reference/java/lang/String permission, int pid, int uid)
`

Determine whether the given permission is allowed for a particular process and user ID
running in the system.


`
abstract


int` `
https://developer.android.com/reference/android/content/Context#checkSelfPermission(java.lang.String)(https://developer.android.com/reference/java/lang/String permission)
`

Determine whether *you* have been granted a particular permission.


`
abstract


int` `
https://developer.android.com/reference/android/content/Context#checkUriPermission(android.net.Uri,%20java.lang.String,%20java.lang.String,%20int,%20int,%20int)(https://developer.android.com/reference/android/net/Uri uri, https://developer.android.com/reference/java/lang/String readPermission, https://developer.android.com/reference/java/lang/String writePermission, int pid, int uid, int modeFlags)
`

Check both a Uri and normal permission.


`
abstract


int` `
https://developer.android.com/reference/android/content/Context#checkUriPermission(android.net.Uri,%20int,%20int,%20int)(https://developer.android.com/reference/android/net/Uri uri, int pid, int uid, int modeFlags)
`

Determine whether a particular process and uid has been granted
permission to access a specific URI.


`


int[]` `
https://developer.android.com/reference/android/content/Context#checkUriPermissions(java.util.List<android.net.Uri>,%20int,%20int,%20int)(https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/net/Uri> uris, int pid, int uid, int modeFlags)
`

Determine whether a particular process and uid has been granted
permission to access a list of URIs.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#clearWallpaper()()
`

*This method was deprecated
in API level 15.
Use `https://developer.android.com/reference/android/app/WallpaperManager#clear()` instead.*

*This method requires the caller to hold the permission
`https://developer.android.com/reference/android/Manifest.permission#SET_WALLPAPER`.*


`


https://developer.android.com/reference/android/content/Context` `
https://developer.android.com/reference/android/content/Context#createAttributionContext(java.lang.String)(https://developer.android.com/reference/java/lang/String attributionTag)
`

Return a new Context object for the current Context but attribute to a different tag.


`
abstract


https://developer.android.com/reference/android/content/Context` `
https://developer.android.com/reference/android/content/Context#createConfigurationContext(android.content.res.Configuration)(https://developer.android.com/reference/android/content/res/Configuration overrideConfiguration)
`

Return a new Context object for the current Context but whose resources
are adjusted to match the given Configuration.


`


https://developer.android.com/reference/android/content/Context` `
https://developer.android.com/reference/android/content/Context#createContext(android.content.ContextParams)(https://developer.android.com/reference/android/content/ContextParams contextParams)
`

Creates a context with specific properties and behaviors.


`
abstract


https://developer.android.com/reference/android/content/Context` `
https://developer.android.com/reference/android/content/Context#createContextForSplit(java.lang.String)(https://developer.android.com/reference/java/lang/String splitName)
`

Return a new Context object for the given split name.


`


https://developer.android.com/reference/android/content/Context` `
https://developer.android.com/reference/android/content/Context#createDeviceContext(int)(int deviceId)
`

Returns a new `Context` object from the current context but with device association
given by the `deviceId`.


`
abstract


https://developer.android.com/reference/android/content/Context` `
https://developer.android.com/reference/android/content/Context#createDeviceProtectedStorageContext()()
`

Return a new Context object for the current Context but whose storage
APIs are backed by device-protected storage.


`
abstract


https://developer.android.com/reference/android/content/Context` `
https://developer.android.com/reference/android/content/Context#createDisplayContext(android.view.Display)(https://developer.android.com/reference/android/view/Display display)
`

Returns a new `Context` object from the current context but with resources
adjusted to match the metrics of `display`.


`
abstract


https://developer.android.com/reference/android/content/Context` `
https://developer.android.com/reference/android/content/Context#createPackageContext(java.lang.String,%20int)(https://developer.android.com/reference/java/lang/String packageName, int flags)
`

Return a new Context object for the given application name.


`


https://developer.android.com/reference/android/content/Context` `
https://developer.android.com/reference/android/content/Context#createWindowContext(int,%20android.os.Bundle)(int type, https://developer.android.com/reference/android/os/Bundle options)
`

Creates a Context for a non-activity window.


`


https://developer.android.com/reference/android/content/Context` `
https://developer.android.com/reference/android/content/Context#createWindowContext(android.view.Display,%20int,%20android.os.Bundle)(https://developer.android.com/reference/android/view/Display display, int type, https://developer.android.com/reference/android/os/Bundle options)
`

Creates a `Context` for a non-`https://developer.android.com/reference/android/app/Activity` window on the given
`https://developer.android.com/reference/android/view/Display`.


`
abstract


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/android/content/Context#databaseList()()
`

Returns an array of strings naming the private databases associated with
this Context's application package.


`
abstract


boolean` `
https://developer.android.com/reference/android/content/Context#deleteDatabase(java.lang.String)(https://developer.android.com/reference/java/lang/String name)
`

Delete an existing private SQLiteDatabase associated with this Context's
application package.


`
abstract


boolean` `
https://developer.android.com/reference/android/content/Context#deleteFile(java.lang.String)(https://developer.android.com/reference/java/lang/String name)
`

Delete the given private file associated with this Context's
application package.


`
abstract


boolean` `
https://developer.android.com/reference/android/content/Context#deleteSharedPreferences(java.lang.String)(https://developer.android.com/reference/java/lang/String name)
`

Delete an existing shared preferences file.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#enforceCallingOrSelfPermission(java.lang.String,%20java.lang.String)(https://developer.android.com/reference/java/lang/String permission, https://developer.android.com/reference/java/lang/String message)
`

If neither you nor the calling process of an IPC you are
handling has been granted a particular permission, throw a
`https://developer.android.com/reference/java/lang/SecurityException`.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#enforceCallingOrSelfUriPermission(android.net.Uri,%20int,%20java.lang.String)(https://developer.android.com/reference/android/net/Uri uri, int modeFlags, https://developer.android.com/reference/java/lang/String message)
`

If the calling process of an IPC *or you* has not been
granted permission to access a specific URI, throw `https://developer.android.com/reference/java/lang/SecurityException`.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#enforceCallingPermission(java.lang.String,%20java.lang.String)(https://developer.android.com/reference/java/lang/String permission, https://developer.android.com/reference/java/lang/String message)
`

If the calling process of an IPC you are handling has not been
granted a particular permission, throw a `https://developer.android.com/reference/java/lang/SecurityException`.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#enforceCallingUriPermission(android.net.Uri,%20int,%20java.lang.String)(https://developer.android.com/reference/android/net/Uri uri, int modeFlags, https://developer.android.com/reference/java/lang/String message)
`

If the calling process and uid has not been granted
permission to access a specific URI, throw `https://developer.android.com/reference/java/lang/SecurityException`.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#enforcePermission(java.lang.String,%20int,%20int,%20java.lang.String)(https://developer.android.com/reference/java/lang/String permission, int pid, int uid, https://developer.android.com/reference/java/lang/String message)
`

If the given permission is not allowed for a particular process
and user ID running in the system, throw a `https://developer.android.com/reference/java/lang/SecurityException`.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#enforceUriPermission(android.net.Uri,%20java.lang.String,%20java.lang.String,%20int,%20int,%20int,%20java.lang.String)(https://developer.android.com/reference/android/net/Uri uri, https://developer.android.com/reference/java/lang/String readPermission, https://developer.android.com/reference/java/lang/String writePermission, int pid, int uid, int modeFlags, https://developer.android.com/reference/java/lang/String message)
`

Enforce both a Uri and normal permission.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#enforceUriPermission(android.net.Uri,%20int,%20int,%20int,%20java.lang.String)(https://developer.android.com/reference/android/net/Uri uri, int pid, int uid, int modeFlags, https://developer.android.com/reference/java/lang/String message)
`

If a particular process and uid has not been granted
permission to access a specific URI, throw `https://developer.android.com/reference/java/lang/SecurityException`.


`
abstract


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/android/content/Context#fileList()()
`

Returns an array of strings naming the private files associated with
this Context's application package.


`
abstract


https://developer.android.com/reference/android/content/Context` `
https://developer.android.com/reference/android/content/Context#getApplicationContext()()
`

Return the context of the single, global Application object of the
current process.


`
abstract


https://developer.android.com/reference/android/content/pm/ApplicationInfo` `
https://developer.android.com/reference/android/content/Context#getApplicationInfo()()
`

Return the full application info for this context's package.


`
abstract


https://developer.android.com/reference/android/content/res/AssetManager` `
https://developer.android.com/reference/android/content/Context#getAssets()()
`

Returns an AssetManager instance for the application's package.


`


https://developer.android.com/reference/android/content/AttributionSource` `
https://developer.android.com/reference/android/content/Context#getAttributionSource()()
` `


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/android/content/Context#getAttributionTag()()
`

<br />

Attribution can be used in complex apps to logically separate parts of the app.


`
abstract


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/Context#getCacheDir()()
`

Returns the absolute path to the application specific cache directory on
the filesystem.


`
abstract


https://developer.android.com/reference/java/lang/ClassLoader` `
https://developer.android.com/reference/android/content/Context#getClassLoader()()
`

Return a class loader you can use to retrieve classes in this package.


`
abstract


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/Context#getCodeCacheDir()()
`

Returns the absolute path to the application specific cache directory on
the filesystem designed for storing cached code.


`


final

int` `
https://developer.android.com/reference/android/content/Context#getColor(int)(int id)
`

Returns a color associated with a particular resource ID and styled for
the current theme.


`


final

https://developer.android.com/reference/android/content/res/ColorStateList` `
https://developer.android.com/reference/android/content/Context#getColorStateList(int)(int id)
`

Returns a color state list associated with a particular resource ID and
styled for the current theme.


`
abstract


https://developer.android.com/reference/android/content/ContentResolver` `
https://developer.android.com/reference/android/content/Context#getContentResolver()()
`

Return a ContentResolver instance for your application's package.


`
abstract


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/Context#getDataDir()()
`

Returns the absolute path to the directory on the filesystem where all
private files belonging to this app are stored.


`
abstract


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/Context#getDatabasePath(java.lang.String)(https://developer.android.com/reference/java/lang/String name)
`

Returns the absolute path on the filesystem where a database created with
`https://developer.android.com/reference/android/content/Context#openOrCreateDatabase(java.lang.String,%20int,%20android.database.sqlite.SQLiteDatabase.CursorFactory)` is stored.


`


int` `
https://developer.android.com/reference/android/content/Context#getDeviceId()()
`

Gets the device ID this context is associated with.


`
abstract


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/Context#getDir(java.lang.String,%20int)(https://developer.android.com/reference/java/lang/String name, int mode)
`

Retrieve, creating if needed, a new directory in which the application
can place its own custom data files.


`


https://developer.android.com/reference/android/view/Display` `
https://developer.android.com/reference/android/content/Context#getDisplay()()
`

Get the display this context is associated with.


`


final

https://developer.android.com/reference/android/graphics/drawable/Drawable` `
https://developer.android.com/reference/android/content/Context#getDrawable(int)(int id)
`

Returns a drawable object associated with a particular resource ID and
styled for the current theme.


`
abstract


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/Context#getExternalCacheDir()()
`

Returns absolute path to application-specific directory on the primary
shared/external storage device where the application can place cache
files it owns.


`
abstract


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/Context#getExternalCacheDirs()()
`

Returns absolute paths to application-specific directories on all
shared/external storage devices where the application can place cache
files it owns.


`
abstract


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/Context#getExternalFilesDir(java.lang.String)(https://developer.android.com/reference/java/lang/String type)
`

Returns the absolute path to the directory on the primary shared/external
storage device where the application can place persistent files it owns.


`
abstract


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/Context#getExternalFilesDirs(java.lang.String)(https://developer.android.com/reference/java/lang/String type)
`

Returns absolute paths to application-specific directories on all
shared/external storage devices where the application can place
persistent files it owns.


`
abstract


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/Context#getExternalMediaDirs()()
`

*This method was deprecated
in API level 30.
These directories still exist and are scanned, but developers
are encouraged to migrate to inserting content into a
`https://developer.android.com/reference/android/provider/MediaStore` collection directly, as any app can
contribute new media to `https://developer.android.com/reference/android/provider/MediaStore` with no
permissions required, starting in
`https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q`.*


`
abstract


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/Context#getFileStreamPath(java.lang.String)(https://developer.android.com/reference/java/lang/String name)
`

Returns the absolute path on the filesystem where a file created with
`https://developer.android.com/reference/android/content/Context#openFileOutput(java.lang.String,%20int)` is stored.


`
abstract


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/Context#getFilesDir()()
`

Returns the absolute path to the directory on the filesystem where files
created with `https://developer.android.com/reference/android/content/Context#openFileOutput(java.lang.String,%20int)` are stored.


`


https://developer.android.com/reference/java/util/concurrent/Executor` `
https://developer.android.com/reference/android/content/Context#getMainExecutor()()
`

Return an `https://developer.android.com/reference/java/util/concurrent/Executor` that will run enqueued tasks on the main
thread associated with this context.


`
abstract


https://developer.android.com/reference/android/os/Looper` `
https://developer.android.com/reference/android/content/Context#getMainLooper()()
`

Return the Looper for the main thread of the current process.


`
abstract


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/Context#getNoBackupFilesDir()()
`

Returns the absolute path to the directory on the filesystem similar to
`https://developer.android.com/reference/android/content/Context#getFilesDir()`.


`
abstract


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/Context#getObbDir()()
`

Return the primary shared/external storage directory where this
application's OBB files (if there are any) can be found.


`
abstract


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/Context#getObbDirs()()
`

Returns absolute paths to application-specific directories on all
shared/external storage devices where the application's OBB files (if
there are any) can be found.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/android/content/Context#getOpPackageName()()
`

Return the package name that should be used for `https://developer.android.com/reference/android/app/AppOpsManager` calls from
this context, so that app ops manager's uid verification will work with the name.


`
abstract


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/android/content/Context#getPackageCodePath()()
`

Return the full path to this context's primary Android package.


`
abstract


https://developer.android.com/reference/android/content/pm/PackageManager` `
https://developer.android.com/reference/android/content/Context#getPackageManager()()
`

Return PackageManager instance to find global package information.


`
abstract


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/android/content/Context#getPackageName()()
`

Return the name of this application's package.


`
abstract


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/android/content/Context#getPackageResourcePath()()
`

Return the full path to this context's primary Android package.


`


https://developer.android.com/reference/android/content/ContextParams` `
https://developer.android.com/reference/android/content/Context#getParams()()
`

Return the set of parameters which this Context was created with, if it
was created via `https://developer.android.com/reference/android/content/Context#createContext(android.content.ContextParams)`.


`
abstract


https://developer.android.com/reference/android/content/res/Resources` `
https://developer.android.com/reference/android/content/Context#getResources()()
`

Returns a Resources instance for the application's package.


`
abstract


https://developer.android.com/reference/android/content/SharedPreferences` `
https://developer.android.com/reference/android/content/Context#getSharedPreferences(java.lang.String,%20int)(https://developer.android.com/reference/java/lang/String name, int mode)
`

Retrieve and hold the contents of the preferences file 'name', returning
a SharedPreferences through which you can retrieve and modify its
values.


`


final

https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/android/content/Context#getString(int)(int resId)
`

Returns a localized string from the application's package's
default string table.


`


final

https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/android/content/Context#getString(int,%20java.lang.Object[])(int resId, https://developer.android.com/reference/java/lang/Object formatArgs)
`

Returns a localized formatted string from the application's package's
default string table, substituting the format arguments as defined in
`https://developer.android.com/reference/java/util/Formatter` and `https://developer.android.com/reference/java/lang/String#format(java.lang.String,%20java.lang.Object[])`.


`


final
<T>
T` `
https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.Class<T>)(https://developer.android.com/reference/java/lang/Class<T> serviceClass)
`

Return the handle to a system-level service by class.


`
abstract


https://developer.android.com/reference/java/lang/Object` `
https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)(https://developer.android.com/reference/java/lang/String name)
`

Return the handle to a system-level service by name.


`
abstract


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/android/content/Context#getSystemServiceName(java.lang.Class<?>)(https://developer.android.com/reference/java/lang/Class<?> serviceClass)
`

Gets the name of the system-level service that is represented by the specified class.


`


final

https://developer.android.com/reference/java/lang/CharSequence` `
https://developer.android.com/reference/android/content/Context#getText(int)(int resId)
`

Return a localized, styled CharSequence from the application's package's
default string table.


`
abstract


https://developer.android.com/reference/android/content/res/Resources.Theme` `
https://developer.android.com/reference/android/content/Context#getTheme()()
`

Return the Theme object associated with this Context.


`


https://developer.android.com/reference/android/content/Context.BindServiceFlags` `
https://developer.android.com/reference/android/content/Context#getUpdateableFlags()()
`

Gets the list of bind flags that may be updated (i.e.


`
abstract


https://developer.android.com/reference/android/graphics/drawable/Drawable` `
https://developer.android.com/reference/android/content/Context#getWallpaper()()
`

*This method was deprecated
in API level 15.
Use `https://developer.android.com/reference/android/app/WallpaperManager#getDrawable()` instead.*


`
abstract


int` `
https://developer.android.com/reference/android/content/Context#getWallpaperDesiredMinimumHeight()()
`

*This method was deprecated
in API level 15.
Use `https://developer.android.com/reference/android/app/WallpaperManager#getDesiredMinimumHeight()` instead.*


`
abstract


int` `
https://developer.android.com/reference/android/content/Context#getWallpaperDesiredMinimumWidth()()
`

*This method was deprecated
in API level 15.
Use `https://developer.android.com/reference/android/app/WallpaperManager#getDesiredMinimumWidth()` instead.*


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#grantUriPermission(java.lang.String,%20android.net.Uri,%20int)(https://developer.android.com/reference/java/lang/String toPackage, https://developer.android.com/reference/android/net/Uri uri, int modeFlags)
`

Grant permission to access a specific Uri to another package, regardless
of whether that package has general permission to access the Uri's
content provider.


`
abstract


boolean` `
https://developer.android.com/reference/android/content/Context#isDeviceProtectedStorage()()
`

Indicates if the storage APIs of this Context are backed by
device-protected storage.


`


boolean` `
https://developer.android.com/reference/android/content/Context#isRestricted()()
`

Indicates whether this Context is restricted.


`


boolean` `
https://developer.android.com/reference/android/content/Context#isUiContext()()
`

Returns `true` if the context is a UI context which can access UI components such as
`https://developer.android.com/reference/android/view/WindowManager`, `https://developer.android.com/reference/android/view/LayoutInflater` or
`https://developer.android.com/reference/android/app/WallpaperManager`.


`
abstract


boolean` `
https://developer.android.com/reference/android/content/Context#moveDatabaseFrom(android.content.Context,%20java.lang.String)(https://developer.android.com/reference/android/content/Context sourceContext, https://developer.android.com/reference/java/lang/String name)
`

Move an existing database file from the given source storage context to
this context.


`
abstract


boolean` `
https://developer.android.com/reference/android/content/Context#moveSharedPreferencesFrom(android.content.Context,%20java.lang.String)(https://developer.android.com/reference/android/content/Context sourceContext, https://developer.android.com/reference/java/lang/String name)
`

Move an existing shared preferences file from the given source storage
context to this context.


`


final

https://developer.android.com/reference/android/content/res/TypedArray` `
https://developer.android.com/reference/android/content/Context#obtainStyledAttributes(android.util.AttributeSet,%20int[])(https://developer.android.com/reference/android/util/AttributeSet set, int[] attrs)
`

Retrieve styled attribute information in this Context's theme.


`


final

https://developer.android.com/reference/android/content/res/TypedArray` `
https://developer.android.com/reference/android/content/Context#obtainStyledAttributes(android.util.AttributeSet,%20int[],%20int,%20int)(https://developer.android.com/reference/android/util/AttributeSet set, int[] attrs, int defStyleAttr, int defStyleRes)
`

Retrieve styled attribute information in this Context's theme.


`


final

https://developer.android.com/reference/android/content/res/TypedArray` `
https://developer.android.com/reference/android/content/Context#obtainStyledAttributes(int,%20int[])(int resid, int[] attrs)
`

Retrieve styled attribute information in this Context's theme.


`


final

https://developer.android.com/reference/android/content/res/TypedArray` `
https://developer.android.com/reference/android/content/Context#obtainStyledAttributes(int[])(int[] attrs)
`

Retrieve styled attribute information in this Context's theme.


`
abstract


https://developer.android.com/reference/java/io/FileInputStream` `
https://developer.android.com/reference/android/content/Context#openFileInput(java.lang.String)(https://developer.android.com/reference/java/lang/String name)
`

Open a private file associated with this Context's application package
for reading.


`
abstract


https://developer.android.com/reference/java/io/FileOutputStream` `
https://developer.android.com/reference/android/content/Context#openFileOutput(java.lang.String,%20int)(https://developer.android.com/reference/java/lang/String name, int mode)
`

Open a private file associated with this Context's application package
for writing.


`
abstract


https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase` `
https://developer.android.com/reference/android/content/Context#openOrCreateDatabase(java.lang.String,%20int,%20android.database.sqlite.SQLiteDatabase.CursorFactory,%20android.database.DatabaseErrorHandler)(https://developer.android.com/reference/java/lang/String name, int mode, https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.CursorFactory factory, https://developer.android.com/reference/android/database/DatabaseErrorHandler errorHandler)
`

Open a new private SQLiteDatabase associated with this Context's
application package.


`
abstract


https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase` `
https://developer.android.com/reference/android/content/Context#openOrCreateDatabase(java.lang.String,%20int,%20android.database.sqlite.SQLiteDatabase.CursorFactory)(https://developer.android.com/reference/java/lang/String name, int mode, https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.CursorFactory factory)
`

Open a new private SQLiteDatabase associated with this Context's
application package.


`
abstract


https://developer.android.com/reference/android/graphics/drawable/Drawable` `
https://developer.android.com/reference/android/content/Context#peekWallpaper()()
`

*This method was deprecated
in API level 15.
Use `https://developer.android.com/reference/android/app/WallpaperManager#peekDrawable()` instead.*


`


void` `
https://developer.android.com/reference/android/content/Context#rebindService(android.content.ServiceConnection,%20android.content.Context.BindServiceFlags)(https://developer.android.com/reference/android/content/ServiceConnection conn, https://developer.android.com/reference/android/content/Context.BindServiceFlags flags)
`

Rebind an application service with updated bind service flags


`


void` `
https://developer.android.com/reference/android/content/Context#registerComponentCallbacks(android.content.ComponentCallbacks)(https://developer.android.com/reference/android/content/ComponentCallbacks callback)
`

Add a new `https://developer.android.com/reference/android/content/ComponentCallbacks` to the base application of the
Context, which will be called at the same times as the ComponentCallbacks
methods of activities and other components are called.


`


void` `
https://developer.android.com/reference/android/content/Context#registerDeviceIdChangeListener(java.util.concurrent.Executor,%20java.util.function.IntConsumer)(https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/java/util/function/IntConsumer listener)
`

Adds a new device ID changed listener to the `Context`, which will be called when
the device association is changed by the system.


`
abstract


https://developer.android.com/reference/android/content/Intent` `
https://developer.android.com/reference/android/content/Context#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter)(https://developer.android.com/reference/android/content/BroadcastReceiver receiver, https://developer.android.com/reference/android/content/IntentFilter filter)
`

Register a BroadcastReceiver to be run in the main activity thread.


`
abstract


https://developer.android.com/reference/android/content/Intent` `
https://developer.android.com/reference/android/content/Context#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter,%20int)(https://developer.android.com/reference/android/content/BroadcastReceiver receiver, https://developer.android.com/reference/android/content/IntentFilter filter, int flags)
`

Register to receive intent broadcasts, with the receiver optionally being
exposed to Instant Apps.


`
abstract


https://developer.android.com/reference/android/content/Intent` `
https://developer.android.com/reference/android/content/Context#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter,%20java.lang.String,%20android.os.Handler,%20int)(https://developer.android.com/reference/android/content/BroadcastReceiver receiver, https://developer.android.com/reference/android/content/IntentFilter filter, https://developer.android.com/reference/java/lang/String broadcastPermission, https://developer.android.com/reference/android/os/Handler scheduler, int flags)
`

Register to receive intent broadcasts, to run in the context of
<var translate="no">scheduler</var>.


`
abstract


https://developer.android.com/reference/android/content/Intent` `
https://developer.android.com/reference/android/content/Context#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter,%20java.lang.String,%20android.os.Handler)(https://developer.android.com/reference/android/content/BroadcastReceiver receiver, https://developer.android.com/reference/android/content/IntentFilter filter, https://developer.android.com/reference/java/lang/String broadcastPermission, https://developer.android.com/reference/android/os/Handler scheduler)
`

Register to receive intent broadcasts, to run in the context of
<var translate="no">scheduler</var>.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#removeStickyBroadcast(android.content.Intent)(https://developer.android.com/reference/android/content/Intent intent)
`

*This method was deprecated
in API level 21.
Sticky broadcasts should not be used. They provide no security (anyone
can access them), no protection (anyone can modify them), and many other problems.
The recommended pattern is to use a non-sticky broadcast to report that *something*
has changed, with another mechanism for apps to retrieve the current value whenever
desired.*


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#removeStickyBroadcastAsUser(android.content.Intent,%20android.os.UserHandle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/os/UserHandle user)
`

*This method was deprecated
in API level 21.
Sticky broadcasts should not be used. They provide no security (anyone
can access them), no protection (anyone can modify them), and many other problems.
The recommended pattern is to use a non-sticky broadcast to report that *something*
has changed, with another mechanism for apps to retrieve the current value whenever
desired.*


`


void` `
https://developer.android.com/reference/android/content/Context#revokeSelfPermissionOnKill(java.lang.String)(https://developer.android.com/reference/java/lang/String permName)
`

Triggers the asynchronous revocation of a runtime permission.


`


void` `
https://developer.android.com/reference/android/content/Context#revokeSelfPermissionsOnKill(java.util.Collection<java.lang.String>)(https://developer.android.com/reference/java/util/Collection<https://developer.android.com/reference/java/lang/String> permissions)
`

Triggers the revocation of one or more permissions for the calling package.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#revokeUriPermission(android.net.Uri,%20int)(https://developer.android.com/reference/android/net/Uri uri, int modeFlags)
`

Remove all permissions to access a particular content provider Uri
that were previously added with `https://developer.android.com/reference/android/content/Context#grantUriPermission(java.lang.String,%20android.net.Uri,%20int)` or *any other* mechanism.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#revokeUriPermission(java.lang.String,%20android.net.Uri,%20int)(https://developer.android.com/reference/java/lang/String toPackage, https://developer.android.com/reference/android/net/Uri uri, int modeFlags)
`

Remove permissions to access a particular content provider Uri
that were previously added with `https://developer.android.com/reference/android/content/Context#grantUriPermission(java.lang.String,%20android.net.Uri,%20int)` for a specific target
package.


`


void` `
https://developer.android.com/reference/android/content/Context#sendBroadcast(android.content.Intent,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/java/lang/String receiverPermission, https://developer.android.com/reference/android/os/Bundle options)
`

Broadcast the given intent to all interested BroadcastReceivers, allowing
an optional required permission to be enforced.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#sendBroadcast(android.content.Intent,%20java.lang.String)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/java/lang/String receiverPermission)
`

Broadcast the given intent to all interested BroadcastReceivers, allowing
an optional required permission to be enforced.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#sendBroadcast(android.content.Intent)(https://developer.android.com/reference/android/content/Intent intent)
`

Broadcast the given intent to all interested BroadcastReceivers.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#sendBroadcastAsUser(android.content.Intent,%20android.os.UserHandle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/os/UserHandle user)
`

Version of `https://developer.android.com/reference/android/content/Context#sendBroadcast(android.content.Intent)` that allows you to specify the
user the broadcast will be sent to.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#sendBroadcastAsUser(android.content.Intent,%20android.os.UserHandle,%20java.lang.String)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/os/UserHandle user, https://developer.android.com/reference/java/lang/String receiverPermission)
`

Version of `https://developer.android.com/reference/android/content/Context#sendBroadcast(android.content.Intent,%20java.lang.String)` that allows you to specify the
user the broadcast will be sent to.


`


void` `
https://developer.android.com/reference/android/content/Context#sendBroadcastWithMultiplePermissions(android.content.Intent,%20java.lang.String[])(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/java/lang/String receiverPermissions)
`

Broadcast the given intent to all interested BroadcastReceivers, allowing
an array of required permissions to be enforced.


`


void` `
https://developer.android.com/reference/android/content/Context#sendOrderedBroadcast(android.content.Intent,%20java.lang.String,%20java.lang.String,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/java/lang/String receiverPermission, https://developer.android.com/reference/java/lang/String receiverAppOp, https://developer.android.com/reference/android/content/BroadcastReceiver resultReceiver, https://developer.android.com/reference/android/os/Handler scheduler, int initialCode, https://developer.android.com/reference/java/lang/String initialData, https://developer.android.com/reference/android/os/Bundle initialExtras)
`

Version of
`https://developer.android.com/reference/android/content/Context#sendOrderedBroadcast(android.content.Intent,%20java.lang.String,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)` that allows you to specify the App Op to enforce restrictions on which receivers
the broadcast will be sent to.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#sendOrderedBroadcast(android.content.Intent,%20java.lang.String,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/java/lang/String receiverPermission, https://developer.android.com/reference/android/content/BroadcastReceiver resultReceiver, https://developer.android.com/reference/android/os/Handler scheduler, int initialCode, https://developer.android.com/reference/java/lang/String initialData, https://developer.android.com/reference/android/os/Bundle initialExtras)
`

Version of `https://developer.android.com/reference/android/content/Context#sendBroadcast(android.content.Intent)` that allows you to
receive data back from the broadcast.


`


void` `
https://developer.android.com/reference/android/content/Context#sendOrderedBroadcast(android.content.Intent,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/java/lang/String receiverPermission, https://developer.android.com/reference/android/os/Bundle options)
`

Broadcast the given intent to all interested BroadcastReceivers, delivering
them one at a time to allow more preferred receivers to consume the
broadcast before it is delivered to less preferred receivers.


`


void` `
https://developer.android.com/reference/android/content/Context#sendOrderedBroadcast(android.content.Intent,%20java.lang.String,%20android.os.Bundle,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/java/lang/String receiverPermission, https://developer.android.com/reference/android/os/Bundle options, https://developer.android.com/reference/android/content/BroadcastReceiver resultReceiver, https://developer.android.com/reference/android/os/Handler scheduler, int initialCode, https://developer.android.com/reference/java/lang/String initialData, https://developer.android.com/reference/android/os/Bundle initialExtras)
`

Version of `https://developer.android.com/reference/android/content/Context#sendBroadcast(android.content.Intent)` that allows you to
receive data back from the broadcast.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#sendOrderedBroadcast(android.content.Intent,%20java.lang.String)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/java/lang/String receiverPermission)
`

Broadcast the given intent to all interested BroadcastReceivers, delivering
them one at a time to allow more preferred receivers to consume the
broadcast before it is delivered to less preferred receivers.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#sendOrderedBroadcastAsUser(android.content.Intent,%20android.os.UserHandle,%20java.lang.String,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/os/UserHandle user, https://developer.android.com/reference/java/lang/String receiverPermission, https://developer.android.com/reference/android/content/BroadcastReceiver resultReceiver, https://developer.android.com/reference/android/os/Handler scheduler, int initialCode, https://developer.android.com/reference/java/lang/String initialData, https://developer.android.com/reference/android/os/Bundle initialExtras)
`

Version of
`https://developer.android.com/reference/android/content/Context#sendOrderedBroadcast(android.content.Intent,%20java.lang.String,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)`
that allows you to specify the
user the broadcast will be sent to.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#sendStickyBroadcast(android.content.Intent)(https://developer.android.com/reference/android/content/Intent intent)
`

*This method was deprecated
in API level 21.
Sticky broadcasts should not be used. They provide no security (anyone
can access them), no protection (anyone can modify them), and many other problems.
The recommended pattern is to use a non-sticky broadcast to report that *something*
has changed, with another mechanism for apps to retrieve the current value whenever
desired.*


`


void` `
https://developer.android.com/reference/android/content/Context#sendStickyBroadcast(android.content.Intent,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/os/Bundle options)
`

*This method was deprecated
in API level 31.
Sticky broadcasts should not be used. They provide no security (anyone
can access them), no protection (anyone can modify them), and many other problems.
The recommended pattern is to use a non-sticky broadcast to report that *something*
has changed, with another mechanism for apps to retrieve the current value whenever
desired.*


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#sendStickyBroadcastAsUser(android.content.Intent,%20android.os.UserHandle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/os/UserHandle user)
`

*This method was deprecated
in API level 21.
Sticky broadcasts should not be used. They provide no security (anyone
can access them), no protection (anyone can modify them), and many other problems.
The recommended pattern is to use a non-sticky broadcast to report that *something*
has changed, with another mechanism for apps to retrieve the current value whenever
desired.*


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#sendStickyOrderedBroadcast(android.content.Intent,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/content/BroadcastReceiver resultReceiver, https://developer.android.com/reference/android/os/Handler scheduler, int initialCode, https://developer.android.com/reference/java/lang/String initialData, https://developer.android.com/reference/android/os/Bundle initialExtras)
`

*This method was deprecated
in API level 21.
Sticky broadcasts should not be used. They provide no security (anyone
can access them), no protection (anyone can modify them), and many other problems.
The recommended pattern is to use a non-sticky broadcast to report that *something*
has changed, with another mechanism for apps to retrieve the current value whenever
desired.*


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#sendStickyOrderedBroadcastAsUser(android.content.Intent,%20android.os.UserHandle,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/os/UserHandle user, https://developer.android.com/reference/android/content/BroadcastReceiver resultReceiver, https://developer.android.com/reference/android/os/Handler scheduler, int initialCode, https://developer.android.com/reference/java/lang/String initialData, https://developer.android.com/reference/android/os/Bundle initialExtras)
`

*This method was deprecated
in API level 21.
Sticky broadcasts should not be used. They provide no security (anyone
can access them), no protection (anyone can modify them), and many other problems.
The recommended pattern is to use a non-sticky broadcast to report that *something*
has changed, with another mechanism for apps to retrieve the current value whenever
desired.*


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#setTheme(int)(int resid)
`

Set the base theme for this context.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#setWallpaper(android.graphics.Bitmap)(https://developer.android.com/reference/android/graphics/Bitmap bitmap)
`

*This method was deprecated
in API level 15.
Use `https://developer.android.com/reference/android/app/WallpaperManager#setBitmap(android.graphics.Bitmap)` instead.*

*This method requires the caller to hold the permission
`https://developer.android.com/reference/android/Manifest.permission#SET_WALLPAPER`.*


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#setWallpaper(java.io.InputStream)(https://developer.android.com/reference/java/io/InputStream data)
`

*This method was deprecated
in API level 15.
Use `https://developer.android.com/reference/android/app/WallpaperManager#setStream(java.io.InputStream)` instead.*

*This method requires the caller to hold the permission
`https://developer.android.com/reference/android/Manifest.permission#SET_WALLPAPER`.*


`


boolean` `
https://developer.android.com/reference/android/content/Context#shouldShowRequestPermissionRationale(java.lang.String)(https://developer.android.com/reference/java/lang/String permission)
`

Gets whether you should show UI with rationale before requesting a permission.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#startActivities(android.content.Intent[],%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intents, https://developer.android.com/reference/android/os/Bundle options)
`

Launch multiple new activities.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#startActivities(android.content.Intent[])(https://developer.android.com/reference/android/content/Intent intents)
`

Same as `https://developer.android.com/reference/android/content/Context#startActivities(android.content.Intent[],%20android.os.Bundle)` with no options
specified.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#startActivity(android.content.Intent)(https://developer.android.com/reference/android/content/Intent intent)
`

Same as `https://developer.android.com/reference/android/content/Context#startActivity(android.content.Intent,%20android.os.Bundle)` with no options
specified.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#startActivity(android.content.Intent,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/os/Bundle options)
`

Launch a new activity.


`
abstract


https://developer.android.com/reference/android/content/ComponentName` `
https://developer.android.com/reference/android/content/Context#startForegroundService(android.content.Intent)(https://developer.android.com/reference/android/content/Intent service)
`

Similar to `https://developer.android.com/reference/android/content/Context#startService(android.content.Intent)`, but with an implicit promise that the
Service will call `https://developer.android.com/reference/android/app/Service#startForeground(int,%20android.app.Notification)` once it begins running.


`
abstract


boolean` `
https://developer.android.com/reference/android/content/Context#startInstrumentation(android.content.ComponentName,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/ComponentName className, https://developer.android.com/reference/java/lang/String profileFile, https://developer.android.com/reference/android/os/Bundle arguments)
`

Start executing an `https://developer.android.com/reference/android/app/Instrumentation` class.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#startIntentSender(android.content.IntentSender,%20android.content.Intent,%20int,%20int,%20int)(https://developer.android.com/reference/android/content/IntentSender intent, https://developer.android.com/reference/android/content/Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags)
`

Same as `https://developer.android.com/reference/android/content/Context#startIntentSender(android.content.IntentSender,%20android.content.Intent,%20int,%20int,%20int,%20android.os.Bundle)`
with no options specified.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#startIntentSender(android.content.IntentSender,%20android.content.Intent,%20int,%20int,%20int,%20android.os.Bundle)(https://developer.android.com/reference/android/content/IntentSender intent, https://developer.android.com/reference/android/content/Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags, https://developer.android.com/reference/android/os/Bundle options)
`

Like `https://developer.android.com/reference/android/content/Context#startActivity(android.content.Intent,%20android.os.Bundle)`, but taking a IntentSender
to start.


`
abstract


https://developer.android.com/reference/android/content/ComponentName` `
https://developer.android.com/reference/android/content/Context#startService(android.content.Intent)(https://developer.android.com/reference/android/content/Intent service)
`

Request that a given application service be started.


`
abstract


boolean` `
https://developer.android.com/reference/android/content/Context#stopService(android.content.Intent)(https://developer.android.com/reference/android/content/Intent service)
`

Request that a given application service be stopped.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#unbindService(android.content.ServiceConnection)(https://developer.android.com/reference/android/content/ServiceConnection conn)
`

Disconnect from an application service.


`


void` `
https://developer.android.com/reference/android/content/Context#unregisterComponentCallbacks(android.content.ComponentCallbacks)(https://developer.android.com/reference/android/content/ComponentCallbacks callback)
`

Remove a `https://developer.android.com/reference/android/content/ComponentCallbacks` object that was previously registered
with `https://developer.android.com/reference/android/content/Context#registerComponentCallbacks(android.content.ComponentCallbacks)`.


`


void` `
https://developer.android.com/reference/android/content/Context#unregisterDeviceIdChangeListener(java.util.function.IntConsumer)(https://developer.android.com/reference/java/util/function/IntConsumer listener)
`

Removes a device ID changed listener from the Context.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#unregisterReceiver(android.content.BroadcastReceiver)(https://developer.android.com/reference/android/content/BroadcastReceiver receiver)
`

Unregister a previously registered BroadcastReceiver.


`


void` `
https://developer.android.com/reference/android/content/Context#updateServiceBindings(java.util.Collection<android.content.Context.UpdateBindingParams>)(https://developer.android.com/reference/java/util/Collection<https://developer.android.com/reference/android/content/Context.UpdateBindingParams> params)
`

Perform a batch update of existing bindings.


`


void` `
https://developer.android.com/reference/android/content/Context#updateServiceGroup(android.content.ServiceConnection,%20int,%20int)(https://developer.android.com/reference/android/content/ServiceConnection conn, int group, int importance)
`

For a service previously bound with `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)` or a related method, change
how the system manages that service's process in relation to other processes.


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/KeyEvent.Callback

` `
abstract


boolean` `
https://developer.android.com/reference/android/view/KeyEvent.Callback#onKeyDown(int,%20android.view.KeyEvent)(int keyCode, https://developer.android.com/reference/android/view/KeyEvent event)
`

Called when a key down event has occurred.


`
abstract


boolean` `
https://developer.android.com/reference/android/view/KeyEvent.Callback#onKeyLongPress(int,%20android.view.KeyEvent)(int keyCode, https://developer.android.com/reference/android/view/KeyEvent event)
`

Called when a long press has occurred.


`
abstract


boolean` `
https://developer.android.com/reference/android/view/KeyEvent.Callback#onKeyMultiple(int,%20int,%20android.view.KeyEvent)(int keyCode, int count, https://developer.android.com/reference/android/view/KeyEvent event)
`

Called when a user's interaction with an analog control, such as
flinging a trackball, generates simulated down/up events for the same
key multiple times in quick succession.


`
abstract


boolean` `
https://developer.android.com/reference/android/view/KeyEvent.Callback#onKeyUp(int,%20android.view.KeyEvent)(int keyCode, https://developer.android.com/reference/android/view/KeyEvent event)
`

Called when a key up event has occurred.


From interface `

https://developer.android.com/reference/android/content/ComponentCallbacks2

` `
abstract


void` `
https://developer.android.com/reference/android/content/ComponentCallbacks2#onTrimMemory(int)(int level)
`

Called when the operating system has determined that it is a good
time for a process to trim unneeded memory from its process.


From interface `

https://developer.android.com/reference/android/content/ComponentCallbacks

` `
abstract


void` `
https://developer.android.com/reference/android/content/ComponentCallbacks#onConfigurationChanged(android.content.res.Configuration)(https://developer.android.com/reference/android/content/res/Configuration newConfig)
`

Called by the system when the device configuration changes while your
component is running.


`
abstract


void` `
https://developer.android.com/reference/android/content/ComponentCallbacks#onLowMemory()()
`

*This method was deprecated
in API level 35.
Since API level 14 this is superseded by
`https://developer.android.com/reference/android/content/ComponentCallbacks2#onTrimMemory(int)`.
Since API level 34 this is never called.
If you're overriding ComponentCallbacks2#onTrimMemory and
your minSdkVersion is greater than API 14, you can provide
an empty implementation for this method.*


## XML attributes

### android:imeExtractEnterAnimation

Animation to use when showing the fullscreen extract UI after
it had previously been hidden.

May be a reference to another resource, in the form
"`@[+][*package*:]*type*/*name*`" or a theme
attribute in the form
"`?[*package*:]*type*/*name*`".

<br />

### android:imeExtractExitAnimation

Animation to use when hiding the fullscreen extract UI after
it had previously been shown.

May be a reference to another resource, in the form
"`@[+][*package*:]*type*/*name*`" or a theme
attribute in the form
"`?[*package*:]*type*/*name*`".

<br />

### android:imeFullscreenBackground

Background to use for entire input method when it is being
shown in fullscreen mode with the extract view, to ensure
that it completely covers the application. This allows,
for example, the candidate view to be hidden
while in fullscreen mode without having the application show through
behind it.

May be a reference to another resource, in the form
"`@[+][*package*:]*type*/*name*`" or a theme
attribute in the form
"`?[*package*:]*type*/*name*`".

May be a color value, in the form of "`#*rgb*`",
"`#*argb*`", "`#*rrggbb*`", or
"`#*aarrggbb*`".

<br />

## Constants

### BACK_DISPOSITION_ADJUST_NOTHING

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

```
public static final int BACK_DISPOSITION_ADJUST_NOTHING
```

Asks the system to not adjust the back button affordance even when the software keyboard is
shown.

This mode is useful for UI modes where IME's main soft input window is used for some
supplemental UI, such as floating candidate window for languages such as Chinese and
Japanese, where users expect the back button is, or at least looks to be, handled by the
target application rather than the UI shown by the IME even while `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#isInputViewShown()`
returns `true`.

Note that `https://developer.android.com/reference/android/view/KeyEvent#KEYCODE_BACK` events continue to be sent to
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onKeyDown(int,%20android.view.KeyEvent)` even when this mode is specified. The default
implementation of `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onKeyDown(int,%20android.view.KeyEvent)` for `https://developer.android.com/reference/android/view/KeyEvent#KEYCODE_BACK` does
not take this mode into account.

For IMEs targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#CINNAMON_BUN` or higher with
`android:enableOnBackInvokedCallback="true"` set in the manifest, specifying this mode
causes back events to bypass the IME and be sent directly to the application. If the IME
still wants to receive back events in this mode, it must register a custom
`https://developer.android.com/reference/android/window/OnBackInvokedCallback`.

<br />

<br />

**See also:**

- `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#setBackDisposition(int)`

Constant Value:

3
(0x00000003)


### BACK_DISPOSITION_DEFAULT

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

```
public static final int BACK_DISPOSITION_DEFAULT
```

Allows the system to optimize the back button affordance based on the presence of software
keyboard.

For instance, on devices that have navigation bar and software-rendered back button, the
system may use a different icon while `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#isInputViewShown()` returns `true`, to
indicate that the back button has "dismiss" affordance.

Note that `https://developer.android.com/reference/android/view/KeyEvent#KEYCODE_BACK` events continue to be sent to
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onKeyDown(int,%20android.view.KeyEvent)` even when this mode is specified. The default
implementation of `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onKeyDown(int,%20android.view.KeyEvent)` for `https://developer.android.com/reference/android/view/KeyEvent#KEYCODE_BACK` does
not take this mode into account.

For API level `https://developer.android.com/reference/android/os/Build.VERSION_CODES#O_MR1` and lower devices, this is the
only mode you can safely specify without worrying about the compatibility.

<br />

<br />

**See also:**

- `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#setBackDisposition(int)`

Constant Value:

0
(0x00000000)


### BACK_DISPOSITION_WILL_DISMISS

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

```
public static final int BACK_DISPOSITION_WILL_DISMISS
```


**This constant was deprecated
in API level 28.**   

on `https://developer.android.com/reference/android/os/Build.VERSION_CODES#P` and later devices, this flag is
handled as a synonym of `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#BACK_DISPOSITION_DEFAULT`. On
`https://developer.android.com/reference/android/os/Build.VERSION_CODES#O_MR1` and prior devices, expected behavior
of this mode had not been well defined. In AOSP implementation running on devices
that have navigation bar, specifying this flag could change the software back
button to "Dismiss" icon no matter whether the software keyboard is shown or not,
but there would be no easy way to restore the icon state even after IME lost the
connection to the application. To avoid user confusions, do not specify this mode
anyway

Deprecated flag.

To avoid compatibility issues, IME developers should not use this flag.

<br />

<br />

**See also:**

- `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#setBackDisposition(int)`

Constant Value:

2
(0x00000002)


### BACK_DISPOSITION_WILL_NOT_DISMISS

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

```
public static final int BACK_DISPOSITION_WILL_NOT_DISMISS
```


**This constant was deprecated
in API level 28.**   

on `https://developer.android.com/reference/android/os/Build.VERSION_CODES#P` and later devices, this flag is
handled as a synonym of `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#BACK_DISPOSITION_DEFAULT`. On
`https://developer.android.com/reference/android/os/Build.VERSION_CODES#O_MR1` and prior devices, expected behavior
of this mode had not been well defined. Most likely the end result would be the
same as `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#BACK_DISPOSITION_DEFAULT`. Either way it is not recommended to
use this mode

Deprecated flag.

To avoid compatibility issues, IME developers should not use this flag.

<br />

<br />

**See also:**

- `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#setBackDisposition(int)`

Constant Value:

1
(0x00000001)


## Public constructors

### InputMethodService

```
public InputMethodService ()
```

<br />

<br />

## Public methods

### enableHardwareAcceleration

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

```
public boolean enableHardwareAcceleration ()
```


**This method was deprecated
in API level 21.**   

Starting in API 21, hardware acceleration is always enabled on capable devices

You can call this to try to enable accelerated drawing for your IME. This must be set before
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onCreate()`, so you will typically call it in your constructor. It is not always
possible to use hardware accelerated drawing in an IME (for example on low-end devices that
do not have the resources to support this), so the call `true` if it succeeds otherwise
`false` if you will need to draw in software. You must be able to handle either case.

In API 21 and later, system may automatically enable hardware accelerated drawing for your
IME on capable devices even if this method is not explicitly called. Make sure that your IME
is able to handle either case.

<br />

<br />

| Returns ||
|---|---|
| `boolean` | `true` if accelerated drawing is successfully enabled otherwise `false`. On API 21 and later devices the return value is basically just a hint and your IME does not need to change the behavior based on the it <br /> |

### finishConnectionlessStylusHandwriting

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

```
public final void finishConnectionlessStylusHandwriting (CharSequence text)
```

Finishes the current connectionless stylus handwriting session and delivers the result.

This dismisses the `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#getStylusHandwritingWindow()` and stops intercepting
stylus `MotionEvent`s.

Note for IME developers: Call this method at any time to finish the current handwriting
session. Generally, this should be invoked after a short timeout, giving the user enough time
to start the next stylus stroke, if any. By default, system will time-out after few seconds.
To override default timeout, use `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#setStylusHandwritingSessionTimeout(java.time.Duration)`.

<br />

| Parameters ||
|---|---|
| `text` | `CharSequence`: This value may be `null`. <br /> |

### finishStylusHandwriting

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

```
public final void finishStylusHandwriting ()
```

Finish the current stylus handwriting session.

This dismisses the `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#getStylusHandwritingWindow()` and stops intercepting
stylus `MotionEvent`s.

Connectionless handwriting sessions should be finished using `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#finishConnectionlessStylusHandwriting(java.lang.CharSequence)`.

Note for IME developers: Call this method at any time to finish the current handwriting
session. Generally, this should be invoked after a short timeout, giving the user enough time
to start the next stylus stroke, if any. By default, system will time-out after few seconds.
To override default timeout, use `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#setStylusHandwritingSessionTimeout(java.time.Duration)`.

Handwriting session will be finished by framework on next `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onFinishInput()`.

<br />

### getBackDisposition

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

```
public int getBackDisposition ()
```

Retrieves the current disposition mode that indicates the expected back button affordance.

<br />

| Returns ||
|---|---|
| `int` | currently selected disposition mode. Value is one of the following: - `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#BACK_DISPOSITION_DEFAULT` - `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#BACK_DISPOSITION_WILL_NOT_DISMISS` - `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#BACK_DISPOSITION_WILL_DISMISS` - `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#BACK_DISPOSITION_ADJUST_NOTHING` |

**See also:**

- `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#setBackDisposition(int)`

### getCandidatesHiddenVisibility

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

```
public int getCandidatesHiddenVisibility ()
```

Returns the visibility mode (either `https://developer.android.com/reference/android/view/View#INVISIBLE`
or `https://developer.android.com/reference/android/view/View#GONE`) of the candidates view when it is not
shown. The default implementation returns GONE when
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService#isExtractViewShown()` returns true,
otherwise INVISIBLE. Be careful if you change this to return GONE in
other situations -- if showing or hiding the candidates view causes
your window to resize, this can cause temporary drawing artifacts as
the resize takes place.

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### getCurrentInputBinding

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

```
public InputBinding getCurrentInputBinding ()
```

Return the currently active InputBinding for the input method, or
null if there is none.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/inputmethod/InputBinding` | <br /> |

### getCurrentInputConnection

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

```
public InputConnection getCurrentInputConnection ()
```

Retrieve the currently active InputConnection that is bound to
the input method, or null if there is none.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/inputmethod/InputConnection` | <br /> |

### getCurrentInputEditorInfo

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

```
public EditorInfo getCurrentInputEditorInfo ()
```

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/inputmethod/EditorInfo` | <br /> |

### getCurrentInputStarted

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

```
public boolean getCurrentInputStarted ()
```

<br />

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### getInputMethodWindowRecommendedHeight

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

```
public int getInputMethodWindowRecommendedHeight ()
```


**This method was deprecated
in API level 29.**   

the actual behavior of this method has never been well defined. You cannot use
this method in a reliable and predictable way

Aimed to return the previous input method's `https://developer.android.com/reference/android/inputmethodservice/InputMethodService.Insets#contentTopInsets`, but its actual
semantics has never been well defined.

Note that the previous document clearly mentioned that this method could return `0`
at any time for whatever reason. Now this method is just always returning `0`.

<br />

<br />

| Returns ||
|---|---|
| `int` | on Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q` and later devices this method always returns `0` <br /> |

### getLayoutInflater

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

```
public LayoutInflater getLayoutInflater ()
```

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/LayoutInflater` | <br /> |

### getMaxWidth

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

```
public int getMaxWidth ()
```

Return the maximum width, in pixels, available the input method.
Input methods are positioned at the bottom of the screen and, unless
running in fullscreen, will generally want to be as short as possible
so should compute their height based on their contents. However, they
can stretch as much as needed horizontally. The function returns to
you the maximum amount of space available horizontally, which you can
use if needed for UI placement.

In many cases this is not needed, you can just rely on the normal
view layout mechanisms to position your views within the full horizontal
space given to the input method.

Note that this value can change dynamically, in particular when the
screen orientation changes.

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### getStylusHandwritingIdleTimeoutMax

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

```
public static final Duration getStylusHandwritingIdleTimeoutMax ()
```

Returns the maximum stylus handwriting session idle-timeout for use with
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService#setStylusHandwritingSessionTimeout(java.time.Duration)`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/time/Duration` | This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onStartStylusHandwriting()`
- `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onFinishStylusHandwriting()`
- `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#getStylusHandwritingSessionTimeout()`

### getStylusHandwritingSessionTimeout

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

```
public final Duration getStylusHandwritingSessionTimeout ()
```

Returns the duration after which an ongoing stylus handwriting session that hasn't received
new `https://developer.android.com/reference/android/view/MotionEvent`s will time out and `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#finishStylusHandwriting()` will be called.
The current timeout can be changed using
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService#setStylusHandwritingSessionTimeout(java.time.Duration)`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/time/Duration` | This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#getStylusHandwritingIdleTimeoutMax()`
- `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onStartStylusHandwriting()`
- `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onFinishStylusHandwriting()`

### getStylusHandwritingWindow

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

```
public final Window getStylusHandwritingWindow ()
```

Returns the stylus handwriting inking window.
IMEs supporting stylus input are expected to attach their inking views to this
window (e.g. with `https://developer.android.com/reference/android/view/Window#setContentView(android.view.View)` )). Handwriting-related
`https://developer.android.com/reference/android/view/MotionEvent`s are dispatched to the attached view hierarchy.

Note: This returns `null` if IME doesn't support stylus handwriting
i.e. if `https://developer.android.com/reference/android/view/inputmethod/InputMethodInfo#supportsStylusHandwriting()` is false.
This method should be called after `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onStartStylusHandwriting()`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/Window` | <br /> |

**See also:**

- `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onStartStylusHandwriting()`

### getSystemService

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

```
public Object getSystemService (String name)
```

Return the handle to a system-level service by name. The class of the returned object varies
by the requested name. Currently available names are:

`https://developer.android.com/reference/android/content/Context#WINDOW_SERVICE` ("window")
:   The top-level window manager in which you can place custom windows. The returned object
    is a `https://developer.android.com/reference/android/view/WindowManager`. Must only be obtained from a visual context
    such as Activity or a Context created with `https://developer.android.com/reference/android/content/Context#createWindowContext(int,%20android.os.Bundle)`,
    which are adjusted to the configuration and visual bounds of an area on screen.

`https://developer.android.com/reference/android/content/Context#LAYOUT_INFLATER_SERVICE` ("layout_inflater")
:   A `https://developer.android.com/reference/android/view/LayoutInflater` for inflating layout resources in this context.
    Must only be obtained from a visual context such as Activity or a Context created with
    `https://developer.android.com/reference/android/content/Context#createWindowContext(int,%20android.os.Bundle)`, which are adjusted to the configuration and
    visual bounds of an area on screen.

`https://developer.android.com/reference/android/content/Context#ACTIVITY_SERVICE` ("activity")
:   A `https://developer.android.com/reference/android/app/ActivityManager` for interacting with the global activity state of
    the system.

`https://developer.android.com/reference/android/content/Context#WALLPAPER_SERVICE` ("wallpaper")
:   A `https://developer.android.com/reference/android/service/wallpaper/WallpaperService` for accessing wallpapers in this
    context. Must only be obtained from a visual context such as Activity or a Context
    created with `https://developer.android.com/reference/android/content/Context#createWindowContext(int,%20android.os.Bundle)`, which are adjusted to the
    configuration and visual bounds of an area on screen.

`https://developer.android.com/reference/android/content/Context#POWER_SERVICE` ("power")
:   A `https://developer.android.com/reference/android/os/PowerManager` for controlling power management.

`https://developer.android.com/reference/android/content/Context#ALARM_SERVICE` ("alarm")
:   A `https://developer.android.com/reference/android/app/AlarmManager` for receiving intents at the time of your choosing.

`https://developer.android.com/reference/android/content/Context#NOTIFICATION_SERVICE` ("notification")
:   A `https://developer.android.com/reference/android/app/NotificationManager` for informing the user of background events.

`https://developer.android.com/reference/android/content/Context#KEYGUARD_SERVICE` ("keyguard")
:   A `https://developer.android.com/reference/android/app/KeyguardManager` for controlling keyguard.

`https://developer.android.com/reference/android/content/Context#LOCATION_SERVICE` ("location")
:   A `https://developer.android.com/reference/android/location/LocationManager` for controlling location (e.g., GPS)
    updates.

`https://developer.android.com/reference/android/content/Context#SEARCH_SERVICE` ("search")
:   A `https://developer.android.com/reference/android/app/SearchManager` for handling search.

`https://developer.android.com/reference/android/content/Context#VIBRATOR_MANAGER_SERVICE` ("vibrator_manager")
:   A `https://developer.android.com/reference/android/os/VibratorManager` for accessing the device vibrators, interacting
    with individual ones and playing synchronized effects on multiple vibrators.

`https://developer.android.com/reference/android/content/Context#MULTISENSORY_MANAGER_SERVICE` ("multisensory_manager")
:   A `https://developer.android.com/reference/android/os/multisensory/MultisensoryManager` for delivering audio-haptic
    feedback in the Multisensory Design System

`https://developer.android.com/reference/android/content/Context#VIBRATOR_SERVICE` ("vibrator")
:   A `https://developer.android.com/reference/android/os/Vibrator` for interacting with the vibrator hardware.

`https://developer.android.com/reference/android/content/Context#CONNECTIVITY_SERVICE` ("connectivity")
:   A `https://developer.android.com/reference/android/net/ConnectivityManager` for handling management
    of network connections.

`https://developer.android.com/reference/android/content/Context#IPSEC_SERVICE` ("ipsec")
:   A `https://developer.android.com/reference/android/net/IpSecManager` for managing IPSec on sockets and
    networks.

`https://developer.android.com/reference/android/content/Context#WIFI_SERVICE` ("wifi")
:   A `https://developer.android.com/reference/android/net/wifi/WifiManager` for management of Wi-Fi
    connectivity. On releases before Android 7, it should only be obtained from an
    application context, and not from any other derived context to avoid memory leaks
    within the calling process.

`https://developer.android.com/reference/android/content/Context#WIFI_AWARE_SERVICE` ("wifiaware")
:   A `https://developer.android.com/reference/android/net/wifi/aware/WifiAwareManager` for management of
    Wi-Fi Aware discovery and connectivity.

`https://developer.android.com/reference/android/content/Context#WIFI_P2P_SERVICE` ("wifip2p")
:   A `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pManager` for management of Wi-Fi
    Direct connectivity.

`https://developer.android.com/reference/android/content/Context#INPUT_METHOD_SERVICE` ("input_method")
:   An `https://developer.android.com/reference/android/view/inputmethod/InputMethodManager` for
    management of input methods.

`https://developer.android.com/reference/android/content/Context#UI_MODE_SERVICE` ("uimode")
:   An `https://developer.android.com/reference/android/app/UiModeManager` for controlling UI modes.

`https://developer.android.com/reference/android/content/Context#DOWNLOAD_SERVICE` ("download")
:   A `https://developer.android.com/reference/android/app/DownloadManager` for requesting HTTP downloads

`https://developer.android.com/reference/android/content/Context#BATTERY_SERVICE` ("batterymanager")
:   A `https://developer.android.com/reference/android/os/BatteryManager` for managing battery state

`https://developer.android.com/reference/android/content/Context#JOB_SCHEDULER_SERVICE` ("taskmanager")
:   A `https://developer.android.com/reference/android/app/job/JobScheduler` for managing scheduled tasks

`https://developer.android.com/reference/android/content/Context#NETWORK_STATS_SERVICE` ("netstats")
:   A `https://developer.android.com/reference/android/app/usage/NetworkStatsManager` for querying
    network usage statistics.

`https://developer.android.com/reference/android/content/Context#HARDWARE_PROPERTIES_SERVICE` ("hardware_properties")
:   A `https://developer.android.com/reference/android/os/HardwarePropertiesManager` for accessing hardware properties.

`https://developer.android.com/reference/android/content/Context#DOMAIN_VERIFICATION_SERVICE` ("domain_verification")
:   A `https://developer.android.com/reference/android/content/pm/verify/domain/DomainVerificationManager` for accessing web
    domain approval state.

`https://developer.android.com/reference/android/content/Context#DISPLAY_HASH_SERVICE` ("display_hash")
:   A `https://developer.android.com/reference/android/view/displayhash/DisplayHashManager` for management of display hashes.

`https://developer.android.com/reference/android/content/Context#AUTHENTICATION_POLICY_SERVICE` ("authentication_policy")
:   A `https://developer.android.com/reference/android/security/authenticationpolicy/AuthenticationPolicyManager` for
    managing authentication related policies on the device.

Note: System services obtained via this API may be closely associated with the Context in
which they are obtained from. In general, do not share the service objects between various
different contexts (Activities, Applications, Services, Providers, etc.)

Note: Instant apps, for which `https://developer.android.com/reference/android/content/pm/PackageManager#isInstantApp()` returns true, don't
have access to the following system services: `https://developer.android.com/reference/android/content/Context#DEVICE_POLICY_SERVICE`, `https://developer.android.com/`, `https://developer.android.com/reference/android/content/Context#KEYGUARD_SERVICE`, `https://developer.android.com/reference/android/content/Context#SHORTCUT_SERVICE`, `https://developer.android.com/reference/android/content/Context#USB_SERVICE`, `https://developer.android.com/reference/android/content/Context#WALLPAPER_SERVICE`, `https://developer.android.com/reference/android/content/Context#WIFI_P2P_SERVICE`, `https://developer.android.com/reference/android/content/Context#WIFI_SERVICE`,
`https://developer.android.com/reference/android/content/Context#WIFI_AWARE_SERVICE`. For these services this method will return `null`.
Generally, if you are running as an instant app you should always check whether the result of
this method is `null`.

Note: When implementing this method, keep in mind that new services can be added on newer
Android releases, so if you're looking for just the explicit names mentioned above, make sure
to return `null` when you don't recognize the name --- if you throw a `https://developer.android.com/reference/java/lang/RuntimeException` exception instead, your app might break on new Android releases.

<br />

| Parameters ||
|---|---|
| `name` | `String`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/Object` | This value may be `null`. <br /> |

### getTextForImeAction

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

```
public CharSequence getTextForImeAction (int imeOptions)
```

Return text that can be used as a button label for the given
`https://developer.android.com/reference/android/view/inputmethod/EditorInfo#imeOptions`. Returns null
if there is no action requested. Note that there is no guarantee that
the returned text will be relatively short, so you probably do not
want to use it as text on a soft keyboard key label.

<br />

| Parameters ||
|---|---|
| `imeOptions` | `int`: The value from `https://developer.android.com/reference/android/view/inputmethod/EditorInfo#imeOptions`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/CharSequence` | Returns a label to use, or null if there is no action. <br /> |

### getWindow

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

```
public Dialog getWindow ()
```

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Dialog` | <br /> |

### hideStatusIcon

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

```
public void hideStatusIcon ()
```

<br />

<br />

### hideWindow

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

```
public void hideWindow ()
```

<br />

<br />

### isExtractViewShown

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

```
public boolean isExtractViewShown ()
```

Return whether the fullscreen extract view is shown. This will only
return true if `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#isFullscreenMode()` returns true, and in that
case its value depends on the last call to
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService#setExtractViewShown(boolean)`. This effectively lets you
determine if the application window is entirely covered (when this
returns true) or if some part of it may be shown (if this returns
false, though if `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#isFullscreenMode()` returns true in that case
then it is probably only a sliver of the application).

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### isFullscreenMode

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

```
public boolean isFullscreenMode ()
```

Return whether the input method is *currently* running in
fullscreen mode. This is the mode that was last determined and
applied by `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#updateFullscreenMode()`.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### isInputViewShown

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

```
public boolean isInputViewShown ()
```

Returns whether the window is currently requested to be shown. Note that despite the method's
name, the returned value does not reflect the window's *actual* visibility.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### isShowInputRequested

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

```
public boolean isShowInputRequested ()
```

Returns whether the window is currently requested to be shown with the input area
*and* can currently be shown. Note that the returned value does not reflect the
window's *actual* visibility.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### onAppPrivateCommand

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

```
public void onAppPrivateCommand (String action, 
                Bundle data)
```

Not implemented in this class.

<br />

| Parameters ||
|---|---|
| `action` | `String` <br /> |
| `data` | `Bundle` <br /> |

### onBindInput

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

```
public void onBindInput ()
```

Called when a new client has bound to the input method. This
may be followed by a series of `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onStartInput(android.view.inputmethod.EditorInfo,%20boolean)`
and `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onFinishInput()` calls as the user navigates through its
UI. Upon this call you know that `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#getCurrentInputBinding()`
and `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#getCurrentInputConnection()` return valid objects.

<br />

### onComputeInsets

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

```
public void onComputeInsets (InputMethodService.Insets outInsets)
```

Compute the interesting insets into your UI. The default implementation
uses the top of the candidates frame for the visible insets, and the
top of the input frame for the content insets. The default touchable
insets are `https://developer.android.com/reference/android/inputmethodservice/InputMethodService.Insets#TOUCHABLE_INSETS_VISIBLE`.

Note that this method is not called when
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService#isExtractViewShown()` returns true, since
in that case the application is left as-is behind the input method and
not impacted by anything in its UI.

<br />

| Parameters ||
|---|---|
| `outInsets` | `InputMethodService.Insets`: Fill in with the current UI insets. <br /> |

### onConfigurationChanged

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

```
public void onConfigurationChanged (Configuration newConfig)
```

Take care of handling configuration changes. Subclasses of
InputMethodService generally don't need to deal directly with
this on their own; the standard implementation here takes care of
regenerating the input method UI as a result of the configuration
change, so you can rely on your `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onCreateInputView()` and
other methods being called as appropriate due to a configuration change.

When a configuration change does happen,
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onInitializeInterface()` is guaranteed to be called the next
time prior to any of the other input or UI creation callbacks. The
following will be called immediately depending if appropriate for current
state: `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onStartInput(android.view.inputmethod.EditorInfo,%20boolean)` if input is active, and
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onCreateInputView()` and `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onStartInputView(android.view.inputmethod.EditorInfo,%20boolean)` and related
appropriate functions if the UI is displayed.

From `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` to `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU` and then
starting with `https://developer.android.com/`, IMEs can opt into handling
configuration changes themselves instead of being restarted with
`https://developer.android.com/reference/android/R.styleable#InputMethod_configChanges`.

Between `https://developer.android.com/reference/android/os/Build.VERSION_CODES#UPSIDE_DOWN_CAKE` and
`https://developer.android.com/reference/android/os/Build.VERSION_CODES#CINNAMON_BUN`, configuration changes that IMEs declared for
themselves to handle were not recognized due to an XML parsing error.

<br />

| Parameters ||
|---|---|
| `newConfig` | `Configuration`: This value cannot be `null`. <br /> |

### onConfigureWindow

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

```
public void onConfigureWindow (Window win, 
                boolean isFullscreen, 
                boolean isCandidatesOnly)
```

Update the given window's parameters for the given mode. This is called
when the window is first displayed and each time the fullscreen or
candidates only mode changes.

The default implementation makes the layout for the window
MATCH_PARENT x MATCH_PARENT when in fullscreen mode, and
MATCH_PARENT x WRAP_CONTENT when in non-fullscreen mode.

<br />

| Parameters ||
|---|---|
| `win` | `Window`: The input method's window. <br /> |
| `isFullscreen` | `boolean`: If true, the window is running in fullscreen mode and intended to cover the entire application display. <br /> |
| `isCandidatesOnly` | `boolean`: If true, the window is only showing the candidates view and none of the rest of its UI. This is mutually exclusive with fullscreen mode. <br /> |

### onCreate

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

```
public void onCreate ()
```

Called by the system when the service is first created. Do not call this method directly.

<br />

### onCreateCandidatesView

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

```
public View onCreateCandidatesView ()
```

Create and return the view hierarchy used to show candidates. This will
be called once, when the candidates are first displayed. You can return
null to have no candidates view; the default implementation returns null.

To control when the candidates view is displayed, use
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService#setCandidatesViewShown(boolean)`.
To change the candidates view after the first one is created by this
function, use `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#setCandidatesView(android.view.View)`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/View` | <br /> |

### onCreateExtractTextView

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

```
public View onCreateExtractTextView ()
```

Called by the framework to create the layout for showing extracted text.
Only called when in fullscreen mode. The returned view hierarchy must
have an `https://developer.android.com/reference/android/inputmethodservice/ExtractEditText` whose ID is
`https://developer.android.com/reference/android/R.id#inputExtractEditText`, with action ID
`https://developer.android.com/reference/android/R.id#inputExtractAction` and accessories ID
`https://developer.android.com/reference/android/R.id#inputExtractAccessories`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/View` | <br /> |

### onCreateInlineSuggestionsRequest

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

```
public InlineSuggestionsRequest onCreateInlineSuggestionsRequest (Bundle uiExtras)
```

Called when Autofill is requesting an `https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsRequest` from the IME.

The Autofill Framework will first request the IME to create and send an
`https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsRequest` back. Once Autofill Framework receives a valid request and
also receives valid inline suggestions, they will be returned via
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onInlineSuggestionsResponse(android.view.inputmethod.InlineSuggestionsResponse)`.

IME Lifecycle - The request will wait to be created after inputStarted

If the IME wants to support displaying inline suggestions, they must set
supportsInlineSuggestions in its XML and implement this method to return a valid
`https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsRequest`.

<br />

<br />

| Parameters ||
|---|---|
| `uiExtras` | `Bundle`: the extras that contain the UI renderer related information. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsRequest` | an `https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsRequest` to be sent to Autofill. This value may be `null`. <br /> |

### onCreateInputMethodInterface

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

```
public AbstractInputMethodService.AbstractInputMethodImpl onCreateInputMethodInterface ()
```


**This method is deprecated.**   

Overriding or calling this method is strongly discouraged. A future version of
Android will remove the ability to use this method. Use the callbacks on
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService` as `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onBindInput()`,
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onUnbindInput()`, `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onWindowShown()`,
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onWindowHidden()`, etc.

Implement to return our standard `https://developer.android.com/reference/android/inputmethodservice/InputMethodService.InputMethodImpl`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService.AbstractInputMethodImpl` | <br /> |

### onCreateInputMethodSessionInterface

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

```
public AbstractInputMethodService.AbstractInputMethodSessionImpl onCreateInputMethodSessionInterface ()
```


**This method is deprecated.**   

Overriding or calling this method is strongly discouraged.
Most methods in `https://developer.android.com/reference/android/inputmethodservice/InputMethodService.InputMethodSessionImpl` have corresponding callbacks.
Use `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onFinishInput()`,
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onDisplayCompletions(android.view.inputmethod.CompletionInfo[])`,
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onUpdateExtractedText(int,%20android.view.inputmethod.ExtractedText)`,
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onUpdateSelection(int,%20int,%20int,%20int,%20int,%20int)` instead.

Implement to return our standard `https://developer.android.com/reference/android/inputmethodservice/InputMethodService.InputMethodSessionImpl`.

IMEs targeting on Android U and above cannot override this method, or an
`https://developer.android.com/reference/java/lang/LinkageError` would be thrown.

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService.AbstractInputMethodSessionImpl` | <br /> |

### onCreateInputView

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

```
public View onCreateInputView ()
```

Create and return the view hierarchy used for the input area (such as
a soft keyboard). This will be called once, when the input area is
first displayed. You can return null to have no input area; the default
implementation returns null.

To control when the input view is displayed, implement
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onEvaluateInputViewShown()`.
To change the input view after the first one is created by this
function, use `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#setInputView(android.view.View)`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/View` | <br /> |

### onCustomImeSwitcherButtonRequestedVisible

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

```
public void onCustomImeSwitcherButtonRequestedVisible (boolean visible)
```

Called when the requested visibility of a custom IME Switcher button changes.

When this method is called with `true` by the system, the IME must show a button
within its UI to switch IMEs. When it is called with `false`, it must hide this button.

Normally, the system provides a button for switching to a different IME when that is
appropriate. Under certain circumstances, namely when the IME successfully asks to hide the
system-provided navigation bar (with `getWindowInsetsController().hide(captionBar())`),
providing this button is delegated to the IME through this callback.

This does not depend on the current visibility of the IME. It could be called with
`true` while the IME is hidden, in which case the IME should prepare to show the button
as soon as the IME itself is shown.

This is only called when the requested visibility changes. The default value is
`false` and as such, this will not be called initially if the resulting value is
`false`.

This can be called at any time after `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onCreate()`, even if the IME is not currently
visible. However, this is not guaranteed to be called before the IME is shown, as it may
depend on the IME requesting to hide the system-provided navigation bar. If the request is
sent during the showing flow (e.g. during `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onStartInputView(android.view.inputmethod.EditorInfo,%20boolean)`), this will be called
shortly after `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onWindowShown()`, but before the first IME frame is drawn.

<br />

| Parameters ||
|---|---|
| `visible` | `boolean`: whether the button is requested visible or not. <br /> |

### onDestroy

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

```
public void onDestroy ()
```

Called by the system to notify a Service that it is no longer used and is being removed. The
service should clean up any resources it holds (threads, registered
receivers, etc) at this point. Upon return, there will be no more calls
in to this Service object and it is effectively dead. Do not call this method directly.

If you override this method you *must* call through to the
superclass implementation.

<br />

### onDisplayCompletions

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

```
public void onDisplayCompletions (CompletionInfo[] completions)
```

Called when the application has reported auto-completion candidates that
it would like to have the input method displayed. Typically these are
only used when an input method is running in full-screen mode, since
otherwise the user can see and interact with the pop-up window of
completions shown by the application.

The default implementation here does nothing.

<br />

| Parameters ||
|---|---|
| `completions` | `CompletionInfo` <br /> |

### onEvaluateFullscreenMode

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

```
public boolean onEvaluateFullscreenMode ()
```

Override this to control when the input method should run in
fullscreen mode. The default implementation runs in fullsceen only
when the screen is in landscape mode. If you change what
this returns, you will need to call `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#updateFullscreenMode()`
yourself whenever the returned value may have changed to have it
re-evaluated and applied.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### onEvaluateInputViewShown

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

```
public boolean onEvaluateInputViewShown ()
```

Override this to control when the soft input area should be shown to the user. The default
implementation returns `false` when there is no hard keyboard or the keyboard is hidden
unless the user shows an intention to use software keyboard. If you change what this
returns, you will need to call `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#updateInputViewShown()` yourself whenever the returned
value may have changed to have it re-evaluated and applied.

When you override this method, it is recommended to call
`super.onEvaluateInputViewShown()` and return `true` when `true` is
returned.
.   
If you override this method you *must* call through to the superclass implementation.

<br />

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### onExtractTextContextMenuItem

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

```
public boolean onExtractTextContextMenuItem (int id)
```

This is called when the user has selected a context menu item from the
extracted text view, when running in fullscreen mode. The default
implementation sends this action to the current InputConnection's
`https://developer.android.com/reference/android/view/inputmethod/InputConnection#performContextMenuAction(int)`, for it
to be processed in underlying "real" editor. Re-implement this to
provide whatever behavior you want.

<br />

| Parameters ||
|---|---|
| `id` | `int` <br /> |

| Returns ||
|---|---|
| `boolean` | <br /> |

### onExtractedCursorMovement

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

```
public void onExtractedCursorMovement (int dx, 
                int dy)
```

This is called when the user has performed a cursor movement in the
extracted text view, when it is running in fullscreen mode. The default
implementation hides the candidates view when a vertical movement
happens, but only if the extracted text editor has a vertical scroll bar
because its text doesn't fit.
Re-implement this to provide whatever behavior you want.

<br />

| Parameters ||
|---|---|
| `dx` | `int`: The amount of cursor movement in the x dimension. <br /> |
| `dy` | `int`: The amount of cursor movement in the y dimension. <br /> |

### onExtractedSelectionChanged

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

```
public void onExtractedSelectionChanged (int start, 
                int end)
```

This is called when the user has moved the cursor in the extracted
text view, when running in fullsreen mode. The default implementation
performs the corresponding selection change on the underlying text
editor.

<br />

| Parameters ||
|---|---|
| `start` | `int` <br /> |
| `end` | `int` <br /> |

### onExtractedTextClicked

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

```
public void onExtractedTextClicked ()
```

This is called when the user has clicked on the extracted text view,
when running in fullscreen mode. The default implementation hides
the candidates view when this happens, but only if the extracted text
editor has a vertical scroll bar because its text doesn't fit.
Re-implement this to provide whatever behavior you want.

<br />

### onExtractingInputChanged

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

```
public void onExtractingInputChanged (EditorInfo ei)
```

This is called when, while currently displayed in extract mode, the
current input target changes. The default implementation will
auto-hide the IME if the new target is not a full editor, since this
can be a confusing experience for the user.

<br />

| Parameters ||
|---|---|
| `ei` | `EditorInfo` <br /> |

### onFinishCandidatesView

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

```
public void onFinishCandidatesView (boolean finishingInput)
```

Called when the candidates view is being hidden from the user. This will
be called either prior to hiding the window, or prior to switching to
another target for editing.

The default
implementation uses the InputConnection to clear any active composing
text; you can override this (not calling the base class implementation)
to perform whatever behavior you would like.

<br />

| Parameters ||
|---|---|
| `finishingInput` | `boolean`: If true, `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onFinishInput()` will be called immediately after. <br /> |

### onFinishInput

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

```
public void onFinishInput ()
```

Called to inform the input method that text input has finished in
the last editor. At this point there may be a call to
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onStartInput(android.view.inputmethod.EditorInfo,%20boolean)` to perform input in a
new editor, or the input method may be left idle. This method is
*not* called when input restarts in the same editor.

The default
implementation uses the InputConnection to clear any active composing
text; you can override this (not calling the base class implementation)
to perform whatever behavior you would like.

<br />

### onFinishInputView

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

```
public void onFinishInputView (boolean finishingInput)
```

Called when the input view is being hidden from the user. This will
be called either prior to hiding the window, or prior to switching to
another target for editing.

The default
implementation uses the InputConnection to clear any active composing
text; you can override this (not calling the base class implementation)
to perform whatever behavior you would like.

<br />

| Parameters ||
|---|---|
| `finishingInput` | `boolean`: If true, `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onFinishInput()` will be called immediately after. <br /> |

### onFinishStylusHandwriting

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

```
public void onFinishStylusHandwriting ()
```

Called when the current stylus handwriting session was finished (either by the system or
via `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#finishStylusHandwriting()`.

When this is called, the ink window has been made invisible, and the IME no longer
intercepts handwriting-related `MotionEvent`s.

<br />

### onGenericMotionEvent

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

```
public boolean onGenericMotionEvent (MotionEvent event)
```

Override this to intercept generic motion events before they are
processed by the application.
If you return true, the application will not itself process the event.
If you return false, the normal application processing will occur as if
the IME had not seen the event at all.

<br />

| Parameters ||
|---|---|
| `event` | `MotionEvent`: The motion event being received. <br /> |

| Returns ||
|---|---|
| `boolean` | True if the event was handled in this function, false otherwise. <br /> |

### onInitializeInterface

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

```
public void onInitializeInterface ()
```

This is a hook that subclasses can use to perform initialization of
their interface. It is called for you prior to any of your UI objects
being created, both after the service is first created and after a
configuration change happens.

<br />

### onInlineSuggestionsResponse

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

```
public boolean onInlineSuggestionsResponse (InlineSuggestionsResponse response)
```

Called when Autofill responds back with `https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsResponse` containing
inline suggestions.

Should be implemented by subclasses.

<br />

<br />

| Parameters ||
|---|---|
| `response` | `InlineSuggestionsResponse`: `https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsResponse` passed back by Autofill. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `boolean` | Whether the IME will use and render the inline suggestions. <br /> |

### onKeyDown

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

```
public boolean onKeyDown (int keyCode, 
                KeyEvent event)
```

Called back when a `https://developer.android.com/reference/android/view/KeyEvent` is forwarded from the target application.

The default implementation intercepts `https://developer.android.com/reference/android/view/KeyEvent#KEYCODE_BACK` if the IME is
currently shown , to possibly hide it when the key goes up (if not canceled or long pressed).
In addition, in fullscreen mode only, it will consume DPAD movement events to move the cursor
in the extracted text view, not allowing them to perform navigation in the underlying
application.

The default implementation does not take flags specified to
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService#setBackDisposition(int)` into account, even on API version
`https://developer.android.com/reference/android/os/Build.VERSION_CODES#P` and later devices. IME developers are responsible
for making sure that their special handling for `https://developer.android.com/reference/android/view/KeyEvent#KEYCODE_BACK` are consistent
with the flag they specified to `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#setBackDisposition(int)`.

<br />

<br />

| Parameters ||
|---|---|
| `keyCode` | `int`: The value in `event.getKeyCode()` <br /> |
| `event` | `KeyEvent`: Description of the key event <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if the event is consumed by the IME and the application no longer needs to consume it. Return `false` when the event should be handled as if the IME had not seen the event at all. <br /> |

### onKeyLongPress

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

```
public boolean onKeyLongPress (int keyCode, 
                KeyEvent event)
```

Default implementation of `https://developer.android.com/reference/android/view/KeyEvent.Callback#onKeyLongPress(int,%20android.view.KeyEvent)`: always returns false (doesn't handle
the event).

<br />

| Parameters ||
|---|---|
| `keyCode` | `int` <br /> |
| `event` | `KeyEvent` <br /> |

| Returns ||
|---|---|
| `boolean` | <br /> |

### onKeyMultiple

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

```
public boolean onKeyMultiple (int keyCode, 
                int count, 
                KeyEvent event)
```

Override this to intercept special key multiple events before they are
processed by the
application. If you return true, the application will not itself
process the event. If you return false, the normal application processing
will occur as if the IME had not seen the event at all.

The default implementation always returns false, except when
in fullscreen mode, where it will consume DPAD movement
events to move the cursor in the extracted text view, not allowing
them to perform navigation in the underlying application.

<br />

| Parameters ||
|---|---|
| `keyCode` | `int` <br /> |
| `count` | `int` <br /> |
| `event` | `KeyEvent` <br /> |

| Returns ||
|---|---|
| `boolean` | <br /> |

### onKeyUp

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

```
public boolean onKeyUp (int keyCode, 
                KeyEvent event)
```

Override this to intercept key up events before they are processed by the
application. If you return true, the application will not itself
process the event. If you return false, the normal application processing
will occur as if the IME had not seen the event at all.

The default implementation intercepts `https://developer.android.com/reference/android/view/KeyEvent#KEYCODE_BACK` to hide the current IME UI if it is shown. In
addition, in fullscreen mode only, it will consume DPAD movement
events to move the cursor in the extracted text view, not allowing
them to perform navigation in the underlying application.

<br />

| Parameters ||
|---|---|
| `keyCode` | `int` <br /> |
| `event` | `KeyEvent` <br /> |

| Returns ||
|---|---|
| `boolean` | <br /> |

### onPrepareStylusHandwriting

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

```
public void onPrepareStylusHandwriting ()
```

Called to prepare stylus handwriting.
The system calls this before the `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onStartStylusHandwriting()` request.

Note: The system tries to call this as early as possible, when it detects that
handwriting stylus input is imminent. However, that a subsequent call to
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onStartStylusHandwriting()` actually happens is not guaranteed.

<br />

<br />

### onShouldVerifyKeyEvent

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

```
public boolean onShouldVerifyKeyEvent (KeyEvent keyEvent)
```

Received by the IME before dispatching to `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onKeyDown(int,%20android.view.KeyEvent)` to determine
if the `https://developer.android.com/reference/android/view/KeyEvent` requires system-level verification of its authenticity.

KeyEvents may originate from outside the system (e.g., injected via shell or
third-party applications). Sensitive keys or those that trigger critical IME actions
should be marked for verification. When marked for verification, the system will check
whether the event originated from a trusted source.

To protect against replay attacks or unauthorized input injection, the system will
drop events that cannot be verified as authentic when they are delivered after an
unexpected delay (exceeding a system-defined threshold). In such cases, the event will
not be delivered to the IME's key handling methods.

<br />

<br />

| Parameters ||
|---|---|
| `keyEvent` | `KeyEvent`: the event that may need verification. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if `https://developer.android.com/reference/android/view/KeyEvent` should be verified for authenticity before dispatch, `false` otherwise. <br /> |

### onShowInputRequested

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

```
public boolean onShowInputRequested (int flags, 
                boolean configChange)
```

The system has decided that it may be time to show your input method.
This is called due to a corresponding call to your
`https://developer.android.com/reference/android/view/inputmethod/InputMethod#showSoftInput(int,%20android.os.ResultReceiver)`
method. The default implementation uses
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onEvaluateInputViewShown()`, `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onEvaluateFullscreenMode()`,
and the current configuration to decide whether the input view should
be shown at this point.

<br />

| Parameters ||
|---|---|
| `flags` | `int` <br /> |
| `configChange` | `boolean`: This is true if we are re-showing due to a configuration change. <br /> |

| Returns ||
|---|---|
| `boolean` | Returns true to indicate that the window should be shown. <br /> |

### onStartCandidatesView

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

```
public void onStartCandidatesView (EditorInfo editorInfo, 
                boolean restarting)
```

Called when only the candidates view has been shown for showing
processing as the user enters text through a hard keyboard.
This will always be called after `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onStartInput(android.view.inputmethod.EditorInfo,%20boolean)`,
allowing you to do your general setup there and just view-specific
setup here. You are guaranteed that `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onCreateCandidatesView()`
will have been called some time before this function is called.

Note that this will *not* be called when the input method
is running in full editing mode, and thus receiving
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onStartInputView(android.view.inputmethod.EditorInfo,%20boolean)` to initiate that operation. This is only
for the case when candidates are being shown while the input method
editor is hidden but wants to show its candidates UI as text is
entered through some other mechanism.

<br />

| Parameters ||
|---|---|
| `editorInfo` | `EditorInfo`: Description of the type of text being edited. <br /> |
| `restarting` | `boolean`: Set to true if we are restarting input on the same text field as before. <br /> |

### onStartConnectionlessStylusHandwriting

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

```
public boolean onStartConnectionlessStylusHandwriting (int inputType, 
                CursorAnchorInfo cursorAnchorInfo)
```

Called when an app requests to start a connectionless stylus handwriting session using one of
`https://developer.android.com/reference/android/view/inputmethod/InputMethodManager#startConnectionlessStylusHandwriting(android.view.View,%20android.view.inputmethod.CursorAnchorInfo,%20java.util.concurrent.Executor,%20android.view.inputmethod.ConnectionlessHandwritingCallback)`, `https://developer.android.com/reference/android/view/inputmethod/InputMethodManager#startConnectionlessStylusHandwritingForDelegation(android.view.View,%20android.view.inputmethod.CursorAnchorInfo,%20java.util.concurrent.Executor,%20android.view.inputmethod.ConnectionlessHandwritingCallback)`, or `https://developer.android.com/reference/android/view/inputmethod/InputMethodManager#startConnectionlessStylusHandwritingForDelegation(android.view.View,%20android.view.inputmethod.CursorAnchorInfo,%20java.lang.String,%20java.util.concurrent.Executor,%20android.view.inputmethod.ConnectionlessHandwritingCallback)`.

A connectionless stylus handwriting session differs from a regular session in that an
input connection is not used to communicate with a text editor. Instead, the recognised text
is delivered when the IME finishes the connectionless session using `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#finishConnectionlessStylusHandwriting(java.lang.CharSequence)`.

If the IME can start the connectionless handwriting session, it should return `true`, ensure its inking views are attached to the `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#getStylusHandwritingWindow()`, and
handle stylus input received from `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onStylusHandwritingMotionEvent(android.view.MotionEvent)` on the
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService#getStylusHandwritingWindow()`.

<br />

| Parameters ||
|---|---|
| `inputType` | `int` <br /> |
| `cursorAnchorInfo` | `CursorAnchorInfo`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `boolean` | <br /> |

### onStartInput

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

```
public void onStartInput (EditorInfo attribute, 
                boolean restarting)
```

Called to inform the input method that text input has started in an
editor. You should use this callback to initialize the state of your
input to match the state of the editor given to it.

<br />

| Parameters ||
|---|---|
| `attribute` | `EditorInfo`: The attributes of the editor that input is starting in. <br /> |
| `restarting` | `boolean`: Set to true if input is restarting in the same editor such as because the application has changed the text in the editor. Otherwise will be false, indicating this is a new session with the editor. <br /> |

### onStartInputView

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

```
public void onStartInputView (EditorInfo editorInfo, 
                boolean restarting)
```

Called when the input view is being shown and input has started on
a new editor. This will always be called after `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onStartInput(android.view.inputmethod.EditorInfo,%20boolean)`,
allowing you to do your general setup there and just view-specific
setup here. You are guaranteed that `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onCreateInputView()` will
have been called some time before this function is called.

<br />

| Parameters ||
|---|---|
| `editorInfo` | `EditorInfo`: Description of the type of text being edited. <br /> |
| `restarting` | `boolean`: Set to true if we are restarting input on the same text field as before. <br /> |

### onStartStylusHandwriting

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

```
public boolean onStartStylusHandwriting ()
```

Called when an app requests stylus handwriting
`https://developer.android.com/reference/android/view/inputmethod/InputMethodManager#startStylusHandwriting(android.view.View)`.

This will always be preceded by `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onStartInput(android.view.inputmethod.EditorInfo,%20boolean)` for the
`https://developer.android.com/reference/android/view/inputmethod/EditorInfo` and `https://developer.android.com/reference/android/view/inputmethod/InputConnection` for which stylus handwriting is being
requested.

If the IME supports handwriting for the current input, it should return `true`,
ensure its inking views are attached to the `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#getStylusHandwritingWindow()`, and handle
stylus input received from `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onStylusHandwritingMotionEvent(android.view.MotionEvent)` on the
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService#getStylusHandwritingWindow()` via `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#getCurrentInputConnection()`.

<br />

| Returns ||
|---|---|
| `boolean` | `true` if IME can honor the request, `false` if IME cannot at this time. <br /> |

### onStylusHandwritingMotionEvent

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

```
public void onStylusHandwritingMotionEvent (MotionEvent motionEvent)
```

Called after `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onStartStylusHandwriting()` returns `true` for every Stylus
`https://developer.android.com/reference/android/view/MotionEvent`.
By default, this method forwards all `https://developer.android.com/reference/android/view/MotionEvent`s to the
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService#getStylusHandwritingWindow()` once its visible, however IME can override it to
receive them sooner.

<br />

| Parameters ||
|---|---|
| `motionEvent` | `MotionEvent`: `https://developer.android.com/reference/android/view/MotionEvent` from stylus. This value cannot be `null`. <br /> |

### onTrackballEvent

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

```
public boolean onTrackballEvent (MotionEvent event)
```

Override this to intercept trackball motion events before they are
processed by the application.
If you return true, the application will not itself process the event.
If you return false, the normal application processing will occur as if
the IME had not seen the event at all.

<br />

| Parameters ||
|---|---|
| `event` | `MotionEvent`: The motion event being received. <br /> |

| Returns ||
|---|---|
| `boolean` | True if the event was handled in this function, false otherwise. <br /> |

### onUnbindInput

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

```
public void onUnbindInput ()
```

Called when the previous bound client is no longer associated
with the input method. After returning `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#getCurrentInputBinding()`
and `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#getCurrentInputConnection()` will no longer return
valid objects.

<br />

### onUpdateCursor

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

```
public void onUpdateCursor (Rect newCursor)
```


**This method was deprecated
in API level 21.**   

Use `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onUpdateCursorAnchorInfo(android.view.inputmethod.CursorAnchorInfo)` instead.

Called when the application has reported a new location of its text
cursor. This is only called if explicitly requested by the input method.
The default implementation does nothing.

<br />

| Parameters ||
|---|---|
| `newCursor` | `Rect` <br /> |

### onUpdateCursorAnchorInfo

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

```
public void onUpdateCursorAnchorInfo (CursorAnchorInfo cursorAnchorInfo)
```

Called when the application has reported a new location of its text insertion point and
characters in the composition string. This is only called if explicitly requested by the
input method. The default implementation does nothing.

<br />

| Parameters ||
|---|---|
| `cursorAnchorInfo` | `CursorAnchorInfo`: The positional information of the text insertion point and the composition string. <br /> |

### onUpdateEditorToolType

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

```
public void onUpdateEditorToolType (int toolType)
```

Called when the user tapped or clicked an editor.
This can be useful when IME makes a decision of showing Virtual keyboard based on what
`https://developer.android.com/reference/android/view/MotionEvent#getToolType(int)` was used to click the editor.
e.g. when toolType is `https://developer.android.com/reference/android/view/MotionEvent#TOOL_TYPE_STYLUS`, IME may choose to show a
companion widget instead of normal virtual keyboard.

This method is called after `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onStartInput(android.view.inputmethod.EditorInfo,%20boolean)` and before
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onStartInputView(android.view.inputmethod.EditorInfo,%20boolean)` when editor was clicked with a known tool
type.

Default implementation does nothing.

<br />

<br />

| Parameters ||
|---|---|
| `toolType` | `int`: what `https://developer.android.com/reference/android/view/MotionEvent#getToolType(int)` was used to click on editor. Value is one of the following: - `https://developer.android.com/reference/android/view/MotionEvent#TOOL_TYPE_UNKNOWN` - `https://developer.android.com/reference/android/view/MotionEvent#TOOL_TYPE_FINGER` - `https://developer.android.com/reference/android/view/MotionEvent#TOOL_TYPE_STYLUS` - `https://developer.android.com/reference/android/view/MotionEvent#TOOL_TYPE_MOUSE` - `https://developer.android.com/reference/android/view/MotionEvent#TOOL_TYPE_ERASER` |

### onUpdateExtractedText

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

```
public void onUpdateExtractedText (int token, 
                ExtractedText text)
```

Called when the application has reported new extracted text to be shown
due to changes in its current text state. The default implementation
here places the new text in the extract edit text, when the input
method is running in fullscreen mode.

<br />

| Parameters ||
|---|---|
| `token` | `int` <br /> |
| `text` | `ExtractedText` <br /> |

### onUpdateExtractingViews

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

```
public void onUpdateExtractingViews (EditorInfo ei)
```

Called when the fullscreen-mode extracting editor info has changed,
to update the state of its UI such as the action buttons shown.
You do not need to deal with this if you are using the standard
full screen extract UI. If replacing it, you will need to re-implement
this to put the appropriate action button in your own UI and handle it,
and perform any other changes.

The standard implementation turns on or off its accessory area
depending on whether there is an action button, and hides or shows
the entire extract area depending on whether it makes sense for the
current editor. In particular, a `https://developer.android.com/reference/android/text/InputType#TYPE_NULL` or
`https://developer.android.com/reference/android/text/InputType#TYPE_TEXT_VARIATION_FILTER` input type will turn off the
extract area since there is no text to be shown.

<br />

| Parameters ||
|---|---|
| `ei` | `EditorInfo` <br /> |

### onUpdateExtractingVisibility

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

```
public void onUpdateExtractingVisibility (EditorInfo ei)
```

Called when the fullscreen-mode extracting editor info has changed,
to determine whether the extracting (extract text and candidates) portion
of the UI should be shown. The standard implementation hides or shows
the extract area depending on whether it makes sense for the
current editor. In particular, a `https://developer.android.com/reference/android/text/InputType#TYPE_NULL`
input type or `https://developer.android.com/reference/android/view/inputmethod/EditorInfo#IME_FLAG_NO_EXTRACT_UI` flag will
turn off the extract area since there is no text to be shown.

<br />

| Parameters ||
|---|---|
| `ei` | `EditorInfo` <br /> |

### onUpdateSelection

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

```
public void onUpdateSelection (int oldSelStart, 
                int oldSelEnd, 
                int newSelStart, 
                int newSelEnd, 
                int candidatesStart, 
                int candidatesEnd)
```

Called when the application has reported a new selection region of
the text. This is called whether or not the input method has requested
extracted text updates, although if so it will not receive this call
if the extracted text has changed as well.

The default implementation takes care of updating the cursor in
the extract text, if it is being shown.

<br />

| Parameters ||
|---|---|
| `oldSelStart` | `int` <br /> |
| `oldSelEnd` | `int` <br /> |
| `newSelStart` | `int` <br /> |
| `newSelEnd` | `int` <br /> |
| `candidatesStart` | `int` <br /> |
| `candidatesEnd` | `int` <br /> |

### onViewClicked

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

```
public void onViewClicked (boolean focusChanged)
```


**This method was deprecated
in API level 29.**   

The method may not be called for composite `https://developer.android.com/reference/android/view/View` that works as a giant
"Canvas", which can host its own UI hierarchy and sub focus state.
`https://developer.android.com/reference/android/webkit/WebView` is a good example. Application / IME developers
should not rely on this method. If your goal is just being notified when an
on-going input is interrupted, simply monitor `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onFinishInput()`.
If your goal is to know what `https://developer.android.com/reference/android/view/MotionEvent#getToolType(int)` clicked on
editor, use `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onUpdateEditorToolType(int)` instead.

Called when the user tapped or clicked a text view.
IMEs can't rely on this method being called because this was not part of the original IME
protocol, so applications with custom text editing written before this method appeared will
not call to inform the IME of this interaction.

<br />

| Parameters ||
|---|---|
| `focusChanged` | `boolean`: true if the user changed the focused view by this click. <br /> |

**See also:**

- `https://developer.android.com/reference/android/view/inputmethod/InputMethodManager#viewClicked(android.view.View)`
- `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onUpdateEditorToolType(int)`

### onWindowHidden

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

```
public void onWindowHidden ()
```

Called when the input method window has been hidden from the user,
after previously being visible.

<br />

### onWindowShown

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

```
public void onWindowShown ()
```

Called immediately before the input method window is shown to the user.
You could override this to prepare for the window to be shown
(update view structure etc).

<br />

### requestHideSelf

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

```
public void requestHideSelf (int flags)
```

Close this input method's soft input area, removing it from the display.

The input method will continue running, but the user can no longer use it to generate input
by touching the screen.

<br />

| Parameters ||
|---|---|
| `flags` | `int`: Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/view/inputmethod/InputMethodManager#HIDE_IMPLICIT_ONLY` - `https://developer.android.com/reference/android/view/inputmethod/InputMethodManager#HIDE_NOT_ALWAYS` |

### requestShowSelf

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

```
public final void requestShowSelf (int flags)
```

Show the input method's soft input area, so the user sees the input method window and can
interact with it.

<br />

| Parameters ||
|---|---|
| `flags` | `int`: Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/view/inputmethod/InputMethodManager#SHOW_IMPLICIT` - `https://developer.android.com/reference/android/view/inputmethod/InputMethodManager#SHOW_FORCED` |

### sendDefaultEditorAction

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

```
public boolean sendDefaultEditorAction (boolean fromEnterKey)
```

Ask the input target to execute its default action via
`https://developer.android.com/reference/android/view/inputmethod/InputConnection#performEditorAction(int)`.

For compatibility, this method does not execute a custom action even if `https://developer.android.com/reference/android/view/inputmethod/EditorInfo#actionLabel` is set. The implementor should directly call
`https://developer.android.com/reference/android/view/inputmethod/InputConnection#performEditorAction(int)` with
`https://developer.android.com/reference/android/view/inputmethod/EditorInfo#actionId` if they want to execute a custom action.

<br />

<br />

| Parameters ||
|---|---|
| `fromEnterKey` | `boolean`: If true, this will be executed as if the user had pressed an enter key on the keyboard, that is it will *not* be done if the editor has set `https://developer.android.com/reference/android/view/inputmethod/EditorInfo#IME_FLAG_NO_ENTER_ACTION`. If false, the action will be sent regardless of how the editor has set that flag. <br /> |

| Returns ||
|---|---|
| `boolean` | Returns a boolean indicating whether an action has been sent. If false, either the editor did not specify a default action or it does not want an action from the enter key. If true, the action was sent (or there was no input connection at all). <br /> |

### sendDownUpKeyEvents

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

```
public void sendDownUpKeyEvents (int keyEventCode)
```

Send the given key event code (as defined by `https://developer.android.com/reference/android/view/KeyEvent`) to the
current input connection is a key down + key up event pair. The sent
events have `https://developer.android.com/reference/android/view/KeyEvent#FLAG_SOFT_KEYBOARD`
set, so that the recipient can identify them as coming from a software
input method, and
`https://developer.android.com/reference/android/view/KeyEvent#FLAG_KEEP_TOUCH_MODE`, so
that they don't impact the current touch mode of the UI.

Note that it's discouraged to send such key events in normal operation;
this is mainly for use with `https://developer.android.com/reference/android/text/InputType#TYPE_NULL` type
text fields, or for non-rich input methods. A reasonably capable software
input method should use the
`https://developer.android.com/reference/android/view/inputmethod/InputConnection#commitText(java.lang.CharSequence,%20int)` family of methods
to send text to an application, rather than sending key events.

<br />

<br />

| Parameters ||
|---|---|
| `keyEventCode` | `int`: The raw key code to send, as defined by `https://developer.android.com/reference/android/view/KeyEvent`. <br /> |

### sendKeyChar

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

```
public void sendKeyChar (char charCode)
```

Send the given UTF-16 character to the current input connection. Most
characters will be delivered simply by calling
`https://developer.android.com/reference/android/view/inputmethod/InputConnection#commitText(java.lang.CharSequence,%20int)` with
the character; some, however, may be handled different. In particular,
the enter character ('\\n') will either be delivered as an action code
or a raw key event, as appropriate. Consider this as a convenience
method for IMEs that do not have a full implementation of actions; a
fully complying IME will decide of the right action for each event and
will likely never call this method except maybe to handle events coming
from an actual hardware keyboard.

<br />

| Parameters ||
|---|---|
| `charCode` | `char`: The UTF-16 character code to send. <br /> |

### setBackDisposition

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

```
public void setBackDisposition (int disposition)
```

Sets the disposition mode that indicates the expected affordance for the back button.

Keep in mind that specifying this flag does not change the the default behavior of
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onKeyDown(int,%20android.view.KeyEvent)`. It is IME developers' responsibility for making sure that
their custom implementation of `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onKeyDown(int,%20android.view.KeyEvent)` is consistent with the mode
specified to this API.

Note: For IMEs targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#CINNAMON_BUN` or higher
with `android:enableOnBackInvokedCallback="true"` set in the manifest, setting the
mode to `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#BACK_DISPOSITION_ADJUST_NOTHING` will cause back events to bypass the IME
and be sent directly to the application.

<br />

<br />

| Parameters ||
|---|---|
| `disposition` | `int`: disposition mode to be set. Value is one of the following: - `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#BACK_DISPOSITION_DEFAULT` - `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#BACK_DISPOSITION_WILL_NOT_DISMISS` - `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#BACK_DISPOSITION_WILL_DISMISS` - `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#BACK_DISPOSITION_ADJUST_NOTHING` |

**See also:**

- `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#getBackDisposition()`

### setCandidatesView

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

```
public void setCandidatesView (View view)
```

Replaces the current candidates view with a new one. You only need to
call this when dynamically changing the view; normally, you should
implement `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onCreateCandidatesView()` and create your view when
first needed by the input method.

<br />

| Parameters ||
|---|---|
| `view` | `View` <br /> |

### setCandidatesViewShown

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

```
public void setCandidatesViewShown (boolean shown)
```

Controls the visibility of the candidates display area. By default
it is hidden.

<br />

| Parameters ||
|---|---|
| `shown` | `boolean` <br /> |

### setExtractView

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

```
public void setExtractView (View view)
```

<br />

<br />

| Parameters ||
|---|---|
| `view` | `View` <br /> |

### setExtractViewShown

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

```
public void setExtractViewShown (boolean shown)
```

Controls the visibility of the extracted text area. This only applies
when the input method is in fullscreen mode, and thus showing extracted
text. When false, the extracted text will not be shown, allowing some
of the application to be seen behind. This is normally set for you
by `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onUpdateExtractingVisibility(android.view.inputmethod.EditorInfo)`. This controls the visibility
of both the extracted text and candidate view; the latter since it is
not useful if there is no text to see.

<br />

| Parameters ||
|---|---|
| `shown` | `boolean` <br /> |

### setInputView

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

```
public void setInputView (View view)
```

Replaces the current input view with a new one. You only need to
call this when dynamically changing the view; normally, you should
implement `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onCreateInputView()` and create your view when
first needed by the input method.

<br />

| Parameters ||
|---|---|
| `view` | `View` <br /> |

### setStylusHandwritingRegion

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

```
public final void setStylusHandwritingRegion (Region handwritingRegion)
```

Sets a new stylus handwriting region as user continues to write on an editor on screen.
Stylus strokes that are started within the `touchableRegion` are treated as
continuation of handwriting and all the events outside are passed-through to the IME target
app, causing stylus handwriting to finish `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#finishStylusHandwriting()`.
By default, the entire screen area is handwritable and `touchableRegion` resets after
each handwriting session.


For example, the IME can use this API to dynamically expand the stylus handwriting region on
every stylus stroke as user continues to write on an editor. The region should grow around
the last stroke so that a UI element below the IME window is still interactable when it is
spaced sufficiently away (\~2 character dimensions) from last stroke.


Note: Setting handwriting touchable region is supported on IMEs that support stylus
handwriting `https://developer.android.com/reference/android/view/inputmethod/InputMethodInfo#supportsStylusHandwriting()`.


Note: If the IME decides to use this API, it should be updating the desired region
accordingly, on configuration changes, such as changes of screen bounds, density.

<br />

<br />

| Parameters ||
|---|---|
| `handwritingRegion` | `Region`: new stylus handwritable `https://developer.android.com/reference/android/graphics/Region` that can accept stylus touch. This value cannot be `null`. <br /> |

### setStylusHandwritingSessionTimeout

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

```
public final void setStylusHandwritingSessionTimeout (Duration duration)
```

Sets the duration after which an ongoing stylus handwriting session that hasn't received new
`https://developer.android.com/reference/android/view/MotionEvent`s will time out and `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#finishStylusHandwriting()` will be called.

The maximum allowed duration is returned by
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService#getStylusHandwritingIdleTimeoutMax()`, larger values will be clamped.

Note: this value is bound to the `https://developer.android.com/reference/android/inputmethodservice/InputMethodService` instance and resets to the
default whenever a new instance is constructed.

<br />

| Parameters ||
|---|---|
| `duration` | `Duration`: timeout to set. This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onStartStylusHandwriting()`
- `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onFinishStylusHandwriting()`
- `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#getStylusHandwritingSessionTimeout()`

### setTheme

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

```
public void setTheme (int theme)
```

You can call this to customize the theme used by your IME's window.
This theme should typically be one that derives from
`https://developer.android.com/reference/android/R.style#Theme_InputMethod`, which is the default theme
you will get. This must be set before `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onCreate()`, so you
will typically call it in your constructor with the resource ID
of your custom theme.

<br />

| Parameters ||
|---|---|
| `theme` | `int`: The style resource describing the theme. <br /> |

### shouldOfferSwitchingToNextInputMethod

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

```
public final boolean shouldOfferSwitchingToNextInputMethod ()
```

Returns true if the current IME needs to offer the users ways to switch to a next input
method (e.g. a globe key.).
When an IME sets supportsSwitchingToNextInputMethod and this method returns true,
the IME has to offer ways to to invoke `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#switchToNextInputMethod(boolean)` accordingly.

Note that the system determines the most appropriate next input method
and subtype in order to provide the consistent user experience in switching
between IMEs and subtypes.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### showStatusIcon

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

```
public void showStatusIcon (int iconResId)
```

<br />

<br />

| Parameters ||
|---|---|
| `iconResId` | `int` <br /> |

### showWindow

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

```
public void showWindow (boolean showInput)
```

<br />

<br />

| Parameters ||
|---|---|
| `showInput` | `boolean` <br /> |

### switchInputMethod

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

```
public void switchInputMethod (String id)
```

Force switch to a new input method, as identified by <var translate="no">id</var>. This
input method will be destroyed, and the requested one started on the
current input field.

<br />

| Parameters ||
|---|---|
| `id` | `String`: Unique identifier of the new input method to start. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the input method is unknown or filtered by the rules of [package visibility](https://developer.android.com/training/basics/intents/package-visibility). |

### switchInputMethod

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

```
public final void switchInputMethod (String id, 
                InputMethodSubtype subtype)
```

Force switch to a new input method, as identified by `id`. This
input method will be destroyed, and the requested one started on the
current input field.

<br />

| Parameters ||
|---|---|
| `id` | `String`: Unique identifier of the new input method to start. <br /> |
| `subtype` | `InputMethodSubtype`: The new subtype of the new input method to be switched to. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the input method is unknown or filtered by the rules of [package visibility](https://developer.android.com/training/basics/intents/package-visibility). |

### switchToNextInputMethod

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

```
public final boolean switchToNextInputMethod (boolean onlyCurrentIme)
```

Force switch to the next input method and subtype. If there is no IME enabled except
current IME and subtype, do nothing.

<br />

| Parameters ||
|---|---|
| `onlyCurrentIme` | `boolean`: if true, the framework will find the next subtype which belongs to the current IME <br /> |

| Returns ||
|---|---|
| `boolean` | true if the current input method and subtype was successfully switched to the next input method and subtype. <br /> |

### switchToPreviousInputMethod

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

```
public final boolean switchToPreviousInputMethod ()
```

Force switch to the last used input method and subtype. If the last input method didn't have
any subtypes, the framework will simply switch to the last input method with no subtype
specified.

<br />

| Returns ||
|---|---|
| `boolean` | true if the current input method and subtype was successfully switched to the last used input method and subtype. <br /> |

### updateFullscreenMode

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

```
public void updateFullscreenMode ()
```

Re-evaluate whether the input method should be running in fullscreen
mode, and update its UI if this has changed since the last time it
was evaluated. This will call `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onEvaluateFullscreenMode()` to
determine whether it should currently run in fullscreen mode. You
can use `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#isFullscreenMode()` to determine if the input method
is currently running in fullscreen mode.

<br />

### updateInputViewShown

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

```
public void updateInputViewShown ()
```

Re-evaluate whether the soft input area should currently be shown, and
update its UI if this has changed since the last time it
was evaluated. This will call `https://developer.android.com/reference/android/inputmethodservice/InputMethodService#onEvaluateInputViewShown()` to
determine whether the input view should currently be shown.

<br />

## Protected methods

### dump

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

```
protected void dump (FileDescriptor fd, 
                PrintWriter fout, 
                String[] args)
```

Performs a dump of the InputMethodService's internal state. Override
to add your own information to the dump.

<br />

| Parameters ||
|---|---|
| `fd` | `FileDescriptor`: The raw file descriptor that the dump is being sent to. <br /> |
| `fout` | `PrintWriter`: The PrintWriter to which you should dump your state. This will be closed for you after you return. <br /> |
| `args` | `String`: additional arguments to the dump request. <br /> |

### onCurrentInputMethodSubtypeChanged

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

```
protected void onCurrentInputMethodSubtypeChanged (InputMethodSubtype newSubtype)
```

Called when the subtype was changed.

<br />

| Parameters ||
|---|---|
| `newSubtype` | `InputMethodSubtype`: the subtype which is being changed to. <br /> |