Configuration Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
This class describes all device configuration information that can impact the resources the application retrieves.
[Android.Runtime.Register("android/content/res/Configuration", DoNotGenerateAcw=true)]
public sealed class Configuration : Java.Lang.Object, Android.OS.IParcelable, IDisposable, Java.Interop.IJavaPeerable, Java.Lang.IComparable
[<Android.Runtime.Register("android/content/res/Configuration", DoNotGenerateAcw=true)>]
type Configuration = class
inherit Object
interface IParcelable
interface IJavaObject
interface IDisposable
interface IJavaPeerable
interface IComparable
- Inheritance
- Attributes
- Implements
Remarks
This class describes all device configuration information that can impact the resources the application retrieves. This includes both user-specified configuration options (locale list and scaling) as well as device configurations (such as input modes, screen size and screen orientation).
You can acquire this object from Resources
, using Resources#getConfiguration
. Thus, from an activity, you can get it by chaining the request with android.app.Activity#getResources
:
Configuration config = getResources().getConfiguration();
Java documentation for android.content.res.Configuration
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Constructors
Configuration() |
Construct an invalid Configuration. |
Configuration(Configuration) |
Makes a deep copy suitable for modification. |
Fields
ColorModeHdrMask |
Obsolete.
Constant for |
ColorModeHdrNo |
Obsolete.
Constant for |
ColorModeHdrShift |
Obsolete.
Constant for |
ColorModeHdrUndefined |
Obsolete.
Constant for |
ColorModeHdrYes |
Obsolete.
Constant for |
ColorModeUndefined |
Obsolete.
Constant for |
ColorModeWideColorGamutMask |
Obsolete.
Constant for |
ColorModeWideColorGamutNo |
Obsolete.
Constant for |
ColorModeWideColorGamutUndefined |
Obsolete.
Constant for |
ColorModeWideColorGamutYes |
Obsolete.
Constant for |
DensityDpiUndefined |
Default value for |
FontWeightAdjustmentUndefined |
An undefined fontWeightAdjustment. |
GrammaticalGenderFeminine |
Obsolete.
Constant for grammatical gender: to indicate the terms of address the user preferred in an application is feminine. |
GrammaticalGenderMasculine |
Obsolete.
Constant for grammatical gender: to indicate the terms of address the user preferred in an application is masculine. |
GrammaticalGenderNeutral |
Obsolete.
Constant for grammatical gender: to indicate the terms of address the user preferred in an application is neuter. |
GrammaticalGenderNotSpecified |
Obsolete.
Constant for grammatical gender: to indicate the user has not specified the terms of address for the application. |
MncZero |
Constant used to to represent MNC (Mobile Network Code) zero. |
ScreenHeightDpUndefined |
Obsolete.
Default value for |
ScreenWidthDpUndefined |
Obsolete.
Default value for |
SmallestScreenWidthDpUndefined |
Default value for |
UiModeNightMask |
Obsolete.
Constant for |
UiModeNightNo |
Obsolete.
Constant for |
UiModeNightUndefined |
Obsolete.
Constant for |
UiModeNightYes |
Obsolete.
Constant for |
UiModeTypeAppliance |
Obsolete.
Constant for |
UiModeTypeCar |
Obsolete.
Constant for |
UiModeTypeDesk |
Obsolete.
Constant for |
UiModeTypeMask |
Obsolete.
Constant for |
UiModeTypeNormal |
Obsolete.
Constant for |
UiModeTypeTelevision |
Obsolete.
Constant for |
UiModeTypeUndefined |
Obsolete.
Constant for |
UiModeTypeVrHeadset |
Obsolete.
Constant for |
UiModeTypeWatch |
Obsolete.
Constant for |
Properties
Class |
Returns the runtime class of this |
ColorMode | |
Creator | |
DensityDpi |
The target screen density being rendered to, corresponding to density resource qualifier. |
FontScale |
Current user preference for the scaling factor for fonts, relative to the base density scaling. |
FontWeightAdjustment |
Adjustment in text font weight. |
GrammaticalGender |
Returns the user preference for the grammatical gender. |
Handle |
The handle to the underlying Android instance. (Inherited from Object) |
HardKeyboardHidden |
A flag indicating whether the hard keyboard has been hidden. |
IsNightModeActive |
Retuns whether the configuration is in night mode |
IsScreenHdr |
Return whether the screen has a high dynamic range. |
IsScreenRound |
Return whether the screen has a round shape. |
IsScreenWideColorGamut |
Return whether the screen has a wide color gamut and wide color gamut rendering is supported by this device. |
JniIdentityHashCode | (Inherited from Object) |
JniPeerMembers | |
Keyboard |
The kind of keyboard attached to the device. |
KeyboardHidden |
A flag indicating whether any keyboard is available. |
LayoutDirection |
Return the layout direction. |
Locale |
Current user preference for the locale, corresponding to locale resource qualifier. |
Locales |
Get the locale list. -or- Set the locale list. |
Mcc |
IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier. |
Mnc |
IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier. |
Navigation |
The kind of navigation method available on the device. |
NavigationHidden |
A flag indicating whether any 5-way or DPAD navigation available. |
Orientation |
Overall orientation of the screen. |
PeerReference | (Inherited from Object) |
ScreenHeightDp |
The height of the available screen space in dp units excluding the area
occupied by |
ScreenLayout |
Bit mask of overall layout of the screen. |
ScreenWidthDp |
The width of the available screen space in dp units excluding the area
occupied by |
SmallestScreenWidthDp |
The smallest screen size an application will see in normal operation. |
ThresholdClass |
This API supports the Mono for Android infrastructure and is not intended to be used directly from your code. (Inherited from Object) |
ThresholdType |
This API supports the Mono for Android infrastructure and is not intended to be used directly from your code. (Inherited from Object) |
Touchscreen |
The kind of touch screen attached to the device. |
UiMode |
Bit mask of the ui mode. |
Methods
Clone() |
Creates and returns a copy of this object. (Inherited from Object) |
CompareTo(Configuration) | |
DescribeContents() |
Parcelable methods |
Diff(Configuration) |
Return a bit mask of the differences between this Configuration object and the given one. |
Dispose() | (Inherited from Object) |
Dispose(Boolean) | (Inherited from Object) |
Equals(Configuration) | |
Equals(Object) |
Indicates whether some other object is "equal to" this one. (Inherited from Object) |
GenerateDelta(Configuration, Configuration) |
Generate a delta Configuration between |
GetHashCode() |
Returns a hash code value for the object. (Inherited from Object) |
IsLayoutSizeAtLeast(Int32) |
Check if the Configuration's current |
JavaFinalize() |
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. (Inherited from Object) |
NeedNewResources(ConfigChanges, ConfigChanges) |
Determines if a new resource needs to be loaded from the bit set of
configuration changes returned by |
Notify() |
Wakes up a single thread that is waiting on this object's monitor. (Inherited from Object) |
NotifyAll() |
Wakes up all threads that are waiting on this object's monitor. (Inherited from Object) |
ReadFromParcel(Parcel) | |
SetHandle(IntPtr, JniHandleOwnership) |
Sets the Handle property. (Inherited from Object) |
SetLayoutDirection(Locale) |
Set the layout direction from a Locale. |
SetLocale(Locale) |
Set the locale list to a list of just one locale. |
SetTo(Configuration) |
Sets the fields in this object to those in the given Configuration. |
SetToDefaults() |
Set this object to the system defaults. |
ToArray<T>() | (Inherited from Object) |
ToString() |
Returns a string representation of the object. (Inherited from Object) |
UnregisterFromRuntime() | (Inherited from Object) |
UpdateFrom(Configuration) |
Copies the fields from delta into this Configuration object, keeping track of which ones have changed. |
Wait() |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>. (Inherited from Object) |
Wait(Int64) |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed. (Inherited from Object) |
Wait(Int64, Int32) |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed. (Inherited from Object) |
WriteToParcel(Parcel, ParcelableWriteFlags) |
Flatten this object in to a Parcel. |
Explicit Interface Implementations
IComparable.CompareTo(Object) | |
IJavaPeerable.Disposed() | (Inherited from Object) |
IJavaPeerable.DisposeUnlessReferenced() | (Inherited from Object) |
IJavaPeerable.Finalized() | (Inherited from Object) |
IJavaPeerable.JniManagedPeerState | (Inherited from Object) |
IJavaPeerable.SetJniIdentityHashCode(Int32) | (Inherited from Object) |
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) | (Inherited from Object) |
IJavaPeerable.SetPeerReference(JniObjectReference) | (Inherited from Object) |
Extension Methods
JavaCast<TResult>(IJavaObject) |
Performs an Android runtime-checked type conversion. |
JavaCast<TResult>(IJavaObject) | |
GetJniTypeName(IJavaPeerable) |