# EditorInfoCompat

added in[version 25.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  
belongs to Maven artifact com.android.support:support-compat:28.0.0-alpha1  
Summary:[Constants](https://developer.android.com/reference/android/support/v13/view/inputmethod/EditorInfoCompat#constants)\|[Ctors](https://developer.android.com/reference/android/support/v13/view/inputmethod/EditorInfoCompat#pubctors)\|[Methods](https://developer.android.com/reference/android/support/v13/view/inputmethod/EditorInfoCompat#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/v13/view/inputmethod/EditorInfoCompat#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/v13/view/inputmethod/EditorInfoCompat#)  

# EditorInfoCompat

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public

final

class
EditorInfoCompat
`  
`

extends Object


``


`

|---|-------------------------------------------------------|
| java.lang.Object                                         ||
| ↳ | android.support.v13.view.inputmethod.EditorInfoCompat |

<br />

*** ** * ** ***

Helper for accessing features in[EditorInfo](https://developer.android.com/reference/android/view/inputmethod/EditorInfo.html)in a backwards compatible fashion.

## Summary

|                                                                                                                                                                                                                                   ### Constants                                                                                                                                                                                                                                   ||
|-------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [IME_FLAG_FORCE_ASCII](https://developer.android.com/reference/android/support/v13/view/inputmethod/EditorInfoCompat#IME_FLAG_FORCE_ASCII) Flag of[imeOptions](https://developer.android.com/reference/android/view/inputmethod/EditorInfo.html#imeOptions): used to request an IME that is capable of inputting ASCII characters.                                                                                                                                         |
| `int` | [IME_FLAG_NO_PERSONALIZED_LEARNING](https://developer.android.com/reference/android/support/v13/view/inputmethod/EditorInfoCompat#IME_FLAG_NO_PERSONALIZED_LEARNING) Flag of[imeOptions](https://developer.android.com/reference/android/view/inputmethod/EditorInfo.html#imeOptions): used to request that the IME does not update any personalized data such as typing history and personalized language model based on what the user typed on this text editing object. |

|                                                             ### Public constructors                                                             ||
|----------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[EditorInfoCompat](https://developer.android.com/reference/android/support/v13/view/inputmethod/EditorInfoCompat#EditorInfoCompat())`() ` |

|                                                                                                                                                                                                                                                                                                                                                                                                   ### Public methods                                                                                                                                                                                                                                                                                                                                                                                                   ||
|--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` static String[]` | ` `[getContentMimeTypes](https://developer.android.com/reference/android/support/v13/view/inputmethod/EditorInfoCompat#getContentMimeTypes(android.view.inputmethod.EditorInfo))`(`[EditorInfo](https://developer.android.com/reference/android/view/inputmethod/EditorInfo.html)` editorInfo) ` Gets MIME types that can be accepted by the target editor if the IME calls[commitContent(InputConnection, EditorInfo, InputContentInfoCompat, int, Bundle)](https://developer.android.com/reference/android/support/v13/view/inputmethod/InputConnectionCompat#commitContent(android.view.inputmethod.InputConnection, android.view.inputmethod.EditorInfo, android.support.v13.view.inputmethod.InputContentInfoCompat, int, android.os.Bundle))                                                 |
| ` static void`     | ` `[setContentMimeTypes](https://developer.android.com/reference/android/support/v13/view/inputmethod/EditorInfoCompat#setContentMimeTypes(android.view.inputmethod.EditorInfo, java.lang.String[]))`(`[EditorInfo](https://developer.android.com/reference/android/view/inputmethod/EditorInfo.html)` editorInfo, String[] contentMimeTypes) ` Sets MIME types that can be accepted by the target editor if the IME calls[commitContent(InputConnection, EditorInfo, InputContentInfoCompat, int, Bundle)](https://developer.android.com/reference/android/support/v13/view/inputmethod/InputConnectionCompat#commitContent(android.view.inputmethod.InputConnection, android.view.inputmethod.EditorInfo, android.support.v13.view.inputmethod.InputContentInfoCompat, int, android.os.Bundle)). |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v13/view/inputmethod/EditorInfoCompat#)From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||

## Constants

### IME_FLAG_FORCE_ASCII

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int IME_FLAG_FORCE_ASCII
```

Flag of[imeOptions](https://developer.android.com/reference/android/view/inputmethod/EditorInfo.html#imeOptions): used to request an IME that is capable of inputting ASCII characters.

The intention of this flag is to ensure that the user can type Roman alphabet characters in a[TextView](https://developer.android.com/reference/android/widget/TextView.html). It is typically used for an account ID or password input.

In many cases, IMEs are already able to input ASCII even without being told so (such IMEs already respect this flag in a sense), but there are cases when this is not the default. For instance, users of languages using a different script like Arabic, Greek, Hebrew or Russian typically have a keyboard that can't input ASCII characters by default.

Applications need to be aware that the flag is not a guarantee, and some IMEs may not respect it. However, it is strongly recommended for IME authors to respect this flag especially when their IME could end up with a state where only languages using non-ASCII are enabled.

<br />

<br />

Constant Value: -2147483648 (0x80000000)  

### IME_FLAG_NO_PERSONALIZED_LEARNING

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int IME_FLAG_NO_PERSONALIZED_LEARNING
```

Flag of[imeOptions](https://developer.android.com/reference/android/view/inputmethod/EditorInfo.html#imeOptions): used to request that the IME does not update any personalized data such as typing history and personalized language model based on what the user typed on this text editing object. Typical use cases are:

- When the application is in a special mode, where user's activities are expected to be not recorded in the application's history. Some web browsers and chat applications may have this kind of modes.
- When storing typing history does not make much sense. Specifying this flag in typing games may help to avoid typing history from being filled up with words that the user is less likely to type in their daily life. Another example is that when the application already knows that the expected input is not a valid word (e.g. a promotion code that is not a valid word in any natural language).

Applications need to be aware that the flag is not a guarantee, and some IMEs may not respect it.

<br />

<br />

Constant Value: 16777216 (0x01000000)

## Public constructors

### EditorInfoCompat

added in[version 25.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
EditorInfoCompat ()
```

<br />

<br />

## Public methods

### getContentMimeTypes

added in[version 25.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String[] getContentMimeTypes (EditorInfo editorInfo)
```

Gets MIME types that can be accepted by the target editor if the IME calls[commitContent(InputConnection, EditorInfo, InputContentInfoCompat, int, Bundle)](https://developer.android.com/reference/android/support/v13/view/inputmethod/InputConnectionCompat#commitContent(android.view.inputmethod.InputConnection, android.view.inputmethod.EditorInfo, android.support.v13.view.inputmethod.InputContentInfoCompat, int, android.os.Bundle))

<br />

|                                   Parameters                                   ||
|--------------|------------------------------------------------------------------|
| `editorInfo` | `EditorInfo`: the editor from which we get the MIME types <br /> |

|                                                                                                                                                                                                                                  Returns                                                                                                                                                                                                                                   ||
|------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `String[]` | an array of MIME types. An empty array means that[commitContent(InputConnection, EditorInfo, InputContentInfoCompat, int, Bundle)](https://developer.android.com/reference/android/support/v13/view/inputmethod/InputConnectionCompat#commitContent(android.view.inputmethod.InputConnection, android.view.inputmethod.EditorInfo, android.support.v13.view.inputmethod.InputContentInfoCompat, int, android.os.Bundle))is not supported on this editor <br /> |

### setContentMimeTypes

added in[version 25.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void setContentMimeTypes (EditorInfo editorInfo, 
                String[] contentMimeTypes)
```

Sets MIME types that can be accepted by the target editor if the IME calls[commitContent(InputConnection, EditorInfo, InputContentInfoCompat, int, Bundle)](https://developer.android.com/reference/android/support/v13/view/inputmethod/InputConnectionCompat#commitContent(android.view.inputmethod.InputConnection, android.view.inputmethod.EditorInfo, android.support.v13.view.inputmethod.InputContentInfoCompat, int, android.os.Bundle)).

<br />

|                                                                                                                                                                                                                                              Parameters                                                                                                                                                                                                                                               ||
|--------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `editorInfo`       | `EditorInfo`: the editor with which we associate supported MIME types <br />                                                                                                                                                                                                                                                                                                                                                                                                      |
| `contentMimeTypes` | `String`: an array of MIME types.`null`and an empty array means that[commitContent(InputConnection, EditorInfo, InputContentInfoCompat, int, Bundle)](https://developer.android.com/reference/android/support/v13/view/inputmethod/InputConnectionCompat#commitContent(android.view.inputmethod.InputConnection, android.view.inputmethod.EditorInfo, android.support.v13.view.inputmethod.InputContentInfoCompat, int, android.os.Bundle))is not supported on this Editor <br /> |

-

  ## Interfaces

  - [InputConnectionCompat.OnCommitContentListener](https://developer.android.com/reference/android/support/v13/view/inputmethod/InputConnectionCompat.OnCommitContentListener)
-

  ## Classes

  - [EditorInfoCompat](https://developer.android.com/reference/android/support/v13/view/inputmethod/EditorInfoCompat)
  - [InputConnectionCompat](https://developer.android.com/reference/android/support/v13/view/inputmethod/InputConnectionCompat)
  - [InputContentInfoCompat](https://developer.android.com/reference/android/support/v13/view/inputmethod/InputContentInfoCompat)