# GrammaticalInflectionManagerCompat

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/app/GrammaticalInflectionManagerCompat.java+class:androidx.core.app.GrammaticalInflectionManagerCompat) Added in [1.12.0](https://developer.android.com/jetpack/androidx/releases/core#1.12.0)

*** ** * ** ***


```
public final class GrammaticalInflectionManagerCompat
```

<br />

*** ** * ** ***

Helper for accessing features in `https://developer.android.com/reference/android/app/GrammaticalInflectionManager.html`.

## Summary

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/core/app/GrammaticalInflectionManagerCompat#GRAMMATICAL_GENDER_FEMININE() = 2` Constant for grammatical gender: to indicate the terms of address the user preferred in an application is feminine. |
| `static final int` | `https://developer.android.com/reference/androidx/core/app/GrammaticalInflectionManagerCompat#GRAMMATICAL_GENDER_MASCULINE() = 3` Constant for grammatical gender: to indicate the terms of address the user preferred in an application is masculine. |
| `static final int` | `https://developer.android.com/reference/androidx/core/app/GrammaticalInflectionManagerCompat#GRAMMATICAL_GENDER_NEUTRAL() = 1` Constant for grammatical gender: to indicate the terms of address the user preferred in an application is neuter. |
| `static final int` | `https://developer.android.com/reference/androidx/core/app/GrammaticalInflectionManagerCompat#GRAMMATICAL_GENDER_NOT_SPECIFIED() = 0` Constant for grammatical gender: to indicate the user has not specified the terms of address for the application. |

| ### Public methods |
|---|---|
| `static int` | `@https://developer.android.com/reference/androidx/annotation/AnyThread https://developer.android.com/reference/androidx/core/app/GrammaticalInflectionManagerCompat#getApplicationGrammaticalGender(android.content.Context)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context)` Returns the current grammatical gender. |
| `static void` | `@https://developer.android.com/reference/androidx/annotation/AnyThread https://developer.android.com/reference/androidx/core/app/GrammaticalInflectionManagerCompat#setRequestedApplicationGrammaticalGender(android.content.Context,int)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context, int grammaticalGender )` Sets the current grammatical gender. |

## Constants

### GRAMMATICAL_GENDER_FEMININE

Added in [1.12.0](https://developer.android.com/jetpack/androidx/releases/core#1.12.0)

```
public static final int GRAMMATICAL_GENDER_FEMININE = 2
```

Constant for grammatical gender: to indicate the terms of address the user preferred in an application is feminine.

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/res/Configuration.html#GRAMMATICAL_GENDER_FEMININE` |   |

### GRAMMATICAL_GENDER_MASCULINE

Added in [1.12.0](https://developer.android.com/jetpack/androidx/releases/core#1.12.0)

```
public static final int GRAMMATICAL_GENDER_MASCULINE = 3
```

Constant for grammatical gender: to indicate the terms of address the user preferred in an application is masculine.

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/res/Configuration.html#GRAMMATICAL_GENDER_MASCULINE` |   |

### GRAMMATICAL_GENDER_NEUTRAL

Added in [1.12.0](https://developer.android.com/jetpack/androidx/releases/core#1.12.0)

```
public static final int GRAMMATICAL_GENDER_NEUTRAL = 1
```

Constant for grammatical gender: to indicate the terms of address the user preferred in an application is neuter.

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/res/Configuration.html#GRAMMATICAL_GENDER_NEUTRAL` |   |

### GRAMMATICAL_GENDER_NOT_SPECIFIED

Added in [1.12.0](https://developer.android.com/jetpack/androidx/releases/core#1.12.0)

```
public static final int GRAMMATICAL_GENDER_NOT_SPECIFIED = 0
```

Constant for grammatical gender: to indicate the user has not specified the terms of address for the application.

| See also |
|---|---|
| `https://developer.android.com/reference/android/content/res/Configuration.html#GRAMMATICAL_GENDER_NOT_SPECIFIED` |   |

## Public methods

### getApplicationGrammaticalGender

Added in [1.12.0](https://developer.android.com/jetpack/androidx/releases/core#1.12.0)

```
@AnyThread
public static int getApplicationGrammaticalGender(@NonNull Context context)
```

Returns the current grammatical gender. No-op on versions prior to `https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#UPSIDE_DOWN_CAKE`.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context` | Context to retrieve service from. |

| Returns |
|---|---|
| `int` | the grammatical gender if device API level is greater than 33, otherwise, return 0. |

### setRequestedApplicationGrammaticalGender

Added in [1.12.0](https://developer.android.com/jetpack/androidx/releases/core#1.12.0)

```
@AnyThread
public static void setRequestedApplicationGrammaticalGender(
    @NonNull Context context,
    int grammaticalGender
)
```

Sets the current grammatical gender. No-op on versions prior to `https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#UPSIDE_DOWN_CAKE`.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context` | Context to retrieve service from. |
| `int grammaticalGender` | the terms of address the user preferred in an application. |