Added in API level 34

GrammaticalInflectionManager


public class GrammaticalInflectionManager
extends Object

java.lang.Object
   ↳ android.app.GrammaticalInflectionManager


This class allow applications to control granular grammatical inflection settings (such as per-app grammatical gender).

Summary

Public methods

int getApplicationGrammaticalGender()

Returns the current grammatical gender for the calling app.

void setRequestedApplicationGrammaticalGender(int grammaticalGender)

Sets the current grammatical gender for the calling app (keyed by package name and user ID retrieved from the calling pid).

Inherited methods

Public methods

getApplicationGrammaticalGender

Added in API level 34
public int getApplicationGrammaticalGender ()

Returns the current grammatical gender for the calling app. A new value can be requested via setRequestedApplicationGrammaticalGender(int) and will be updated with a new configuration change. The method always returns the value received with the last received configuration change.

Returns
int the value of grammatical gender Value is Configuration.GRAMMATICAL_GENDER_NOT_SPECIFIED, Configuration.GRAMMATICAL_GENDER_NEUTRAL, Configuration.GRAMMATICAL_GENDER_FEMININE, or Configuration.GRAMMATICAL_GENDER_MASCULINE

setRequestedApplicationGrammaticalGender

Added in API level 34
public void setRequestedApplicationGrammaticalGender (int grammaticalGender)

Sets the current grammatical gender for the calling app (keyed by package name and user ID retrieved from the calling pid).

Note: Changes to app grammatical gender will result in a configuration change (and potentially an Activity re-creation) being applied to the specified application. For more information, see the section on handling configuration changes. The set grammatical gender are persisted across application restarts; they are backed up if the user has enabled Backup & Restore.`

Parameters
grammaticalGender int: the terms of address the user preferred in an application. Value is Configuration.GRAMMATICAL_GENDER_NOT_SPECIFIED, Configuration.GRAMMATICAL_GENDER_NEUTRAL, Configuration.GRAMMATICAL_GENDER_FEMININE, or Configuration.GRAMMATICAL_GENDER_MASCULINE