Configuration Configuration Class

Definition

This class describes all device configuration information that can impact the resources the application retrieves.

[Android.Runtime.Register("android/content/res/Configuration", ApiSince=1, DoNotGenerateAcw=true)]
public sealed class Configuration : Java.Lang.Object, Android.OS.IParcelable, IDisposable, Java.Lang.IComparable
type Configuration = class
    inherit Object
    interface IParcelable
    interface IJavaObject
    interface IDisposable
    interface IComparable
Inheritance
ConfigurationConfiguration
Attributes
Implements

Remarks

Android platform documentation

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() Configuration()

Construct an invalid Configuration.

Configuration(Configuration) Configuration(Configuration)

Makes a deep copy suitable for modification.

Fields

ColorModeHdrMask ColorModeHdrMask
ColorModeHdrNo ColorModeHdrNo
ColorModeHdrShift ColorModeHdrShift
ColorModeHdrUndefined ColorModeHdrUndefined
ColorModeHdrYes ColorModeHdrYes
ColorModeUndefined ColorModeUndefined
ColorModeWideColorGamutMask ColorModeWideColorGamutMask
ColorModeWideColorGamutNo ColorModeWideColorGamutNo
ColorModeWideColorGamutUndefined ColorModeWideColorGamutUndefined
ColorModeWideColorGamutYes ColorModeWideColorGamutYes
DensityDpiUndefined DensityDpiUndefined

Default value for DensityDpi indicating that no width has been specified.

MncZero MncZero

Constant used to to represent MNC (Mobile Network Code) zero. 0 cannot be used, since it is used to represent an undefined MNC.

ScreenHeightDpUndefined ScreenHeightDpUndefined

Default value for ScreenHeightDp indicating that no width has been specified.

ScreenWidthDpUndefined ScreenWidthDpUndefined

Default value for ScreenWidthDp indicating that no width has been specified.

SmallestScreenWidthDpUndefined SmallestScreenWidthDpUndefined

Default value for SmallestScreenWidthDp indicating that no width has been specified.

UiModeNightMask UiModeNightMask

Constant for UiMode: bits that encode the night mode.

UiModeNightNo UiModeNightNo

Constant for UiMode: a UiModeNightMask value that corresponds to the notnight resource qualifier.

UiModeNightUndefined UiModeNightUndefined

Constant for UiMode: a UiModeNightMask value indicating that no mode type has been set.

UiModeNightYes UiModeNightYes

Constant for UiMode: a UiModeNightMask value that corresponds to the night resource qualifier.

UiModeTypeAppliance UiModeTypeAppliance

Constant for UiMode: a UiModeTypeMask value that corresponds to the appliance resource qualifier.

UiModeTypeCar UiModeTypeCar

Constant for UiMode: a UiModeTypeMask value that corresponds to the car resource qualifier.

UiModeTypeDesk UiModeTypeDesk

Constant for UiMode: a UiModeTypeMask value that corresponds to the desk resource qualifier.

UiModeTypeMask UiModeTypeMask

Constant for UiMode: bits that encode the mode type.

UiModeTypeNormal UiModeTypeNormal

Constant for UiMode: a UiModeTypeMask value that corresponds to no UI mode resource qualifier specified.

UiModeTypeTelevision UiModeTypeTelevision

Constant for UiMode: a UiModeTypeMask value that corresponds to the television resource qualifier.

UiModeTypeUndefined UiModeTypeUndefined

Constant for UiMode: a UiModeTypeMask value indicating that no mode type has been set.

UiModeTypeVrHeadset UiModeTypeVrHeadset
UiModeTypeWatch UiModeTypeWatch

Constant for UiMode: a UiModeTypeMask value that corresponds to the watch resource qualifier.

Properties

Class Class

Returns the unique instance of Class that represents this object's class.

(Inherited from Object)
ColorMode ColorMode
Creator Creator
DensityDpi DensityDpi

density

FontScale FontScale

Current user preference for the scaling factor for fonts, relative to the base density scaling.

Handle Handle

The handle to the underlying Android instance.

(Inherited from Object)
HardKeyboardHidden HardKeyboardHidden

A flag indicating whether the hard keyboard has been hidden.

IJavaObjectEx.IsProxy IJavaObjectEx.IsProxy Inherited from Object
IJavaObjectEx.KeyHandle IJavaObjectEx.KeyHandle Inherited from Object
IJavaObjectEx.NeedsActivation IJavaObjectEx.NeedsActivation Inherited from Object
IJavaPeerable.JniManagedPeerState IJavaPeerable.JniManagedPeerState Inherited from Object
IsScreenHdr IsScreenHdr
IsScreenRound IsScreenRound
IsScreenWideColorGamut IsScreenWideColorGamut
JniIdentityHashCode JniIdentityHashCode Inherited from Object
JniPeerMembers JniPeerMembers
Keyboard Keyboard

The kind of keyboard attached to the device.

KeyboardHidden KeyboardHidden

A flag indicating whether any keyboard is available.

LayoutDirection LayoutDirection

Return the layout direction.

Locale Locale

locale

Locales Locales
Mcc Mcc

mcc

Mnc Mnc

mnc

Navigation Navigation

The kind of navigation method available on the device.

NavigationHidden NavigationHidden

A flag indicating whether any 5-way or DPAD navigation available.

Orientation Orientation

Overall orientation of the screen.

PeerReference PeerReference Inherited from Object
ScreenHeightDp ScreenHeightDp

screen height

ScreenLayout ScreenLayout

Bit mask of overall layout of the screen.

ScreenWidthDp ScreenWidthDp

screen width

SmallestScreenWidthDp SmallestScreenWidthDp

smallest screen width

ThresholdClass ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)
ThresholdType ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)
Touchscreen Touchscreen

The kind of touch screen attached to the device.

UiMode UiMode

Bit mask of the ui mode.

Methods

Clone() Clone()

Creates and returns a copy of this Object.

(Inherited from Object)
CompareTo(Configuration) CompareTo(Configuration)
DescribeContents() DescribeContents()

Parcelable methods

Diff(Configuration) Diff(Configuration)

Return a bit mask of the differences between this Configuration object and the given one.

Dispose() Dispose() Inherited from Object
Dispose(Boolean) Dispose(Boolean) Inherited from Object
Equals(Configuration) Equals(Configuration)
Equals(Object) Equals(Object)

Compares this instance with the specified object and indicates if they are equal.

(Inherited from Object)
GetHashCode() GetHashCode()

Returns an integer hash code for this object.

(Inherited from Object)
IsLayoutSizeAtLeast(Int32) IsLayoutSizeAtLeast(Int32)

Check if the Configuration's current ScreenLayout is at least the given size.

JavaFinalize() JavaFinalize()

Invoked when the garbage collector has detected that this instance is no longer reachable.

(Inherited from Object)
NeedNewResources(ConfigChanges, ConfigChanges) NeedNewResources(ConfigChanges, ConfigChanges)

Determine if a new resource needs to be loaded from the bit set of configuration changes returned by UpdateFrom(Configuration).

Notify() Notify()

Causes a thread which is waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
NotifyAll() NotifyAll()

Causes all threads which are waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
ReadFromParcel(Parcel) ReadFromParcel(Parcel)
SetHandle(IntPtr, JniHandleOwnership) SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetLayoutDirection(Locale) SetLayoutDirection(Locale)

Set the layout direction from the Locale.

SetLocale(Locale) SetLocale(Locale)

Set the locale.

SetTo(Configuration) SetTo(Configuration)
SetToDefaults() SetToDefaults()

Set this object to the system defaults.

ToArray<T>() ToArray<T>() Inherited from Object
ToString() ToString()

Returns a string containing a concise, human-readable description of this object.

(Inherited from Object)
UnregisterFromRuntime() UnregisterFromRuntime() Inherited from Object
UpdateFrom(Configuration) UpdateFrom(Configuration)

Copy the fields from delta into this Configuration object, keeping track of which ones have changed.

Wait() Wait()

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.

(Inherited from Object)
Wait(Int64) Wait(Int64)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)
Wait(Int64, Int32) Wait(Int64, Int32)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)
WriteToParcel(Parcel, ParcelableWriteFlags) WriteToParcel(Parcel, ParcelableWriteFlags)

Flatten this object in to a Parcel.

Explicit Interface Implementations

IComparable.CompareTo(Object) IComparable.CompareTo(Object)
IJavaObjectEx.ToLocalJniHandle() IJavaObjectEx.ToLocalJniHandle() Inherited from Object
IJavaPeerable.Disposed() IJavaPeerable.Disposed() Inherited from Object
IJavaPeerable.DisposeUnlessReferenced() IJavaPeerable.DisposeUnlessReferenced() Inherited from Object
IJavaPeerable.Finalized() IJavaPeerable.Finalized() Inherited from Object
IJavaPeerable.SetJniIdentityHashCode(Int32) IJavaPeerable.SetJniIdentityHashCode(Int32) Inherited from Object
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) Inherited from Object
IJavaPeerable.SetPeerReference(JniObjectReference) IJavaPeerable.SetPeerReference(JniObjectReference) Inherited from Object

Extension Methods

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable) GetJniTypeName(IJavaPeerable)

Applies to