to top
Android APIs
public final class

Configuration

extends Object
implements Parcelable Comparable<T>
java.lang.Object
   ↳ android.content.res.Configuration

Class Overview

This class describes all device configuration information that can impact the resources the application retrieves. This includes both user-specified configuration options (locale and scaling) as well as device configurations (such as input modes, screen size and screen orientation).

You can acquire this object from Resources, using getConfiguration(). Thus, from an activity, you can get it by chaining the request with getResources():

Configuration config = getResources().getConfiguration();

Summary

Constants
int HARDKEYBOARDHIDDEN_NO Constant for hardKeyboardHidden, value corresponding to the physical keyboard being exposed.
int HARDKEYBOARDHIDDEN_UNDEFINED Constant for hardKeyboardHidden: a value indicating that no value has been set.
int HARDKEYBOARDHIDDEN_YES Constant for hardKeyboardHidden, value corresponding to the physical keyboard being hidden.
int KEYBOARDHIDDEN_NO Constant for keyboardHidden, value corresponding to the keysexposed resource qualifier.
int KEYBOARDHIDDEN_UNDEFINED Constant for keyboardHidden: a value indicating that no value has been set.
int KEYBOARDHIDDEN_YES Constant for keyboardHidden, value corresponding to the keyshidden resource qualifier.
int KEYBOARD_12KEY Constant for keyboard, value corresponding to the 12key resource qualifier.
int KEYBOARD_NOKEYS Constant for keyboard, value corresponding to the nokeys resource qualifier.
int KEYBOARD_QWERTY Constant for keyboard, value corresponding to the qwerty resource qualifier.
int KEYBOARD_UNDEFINED Constant for keyboard: a value indicating that no value has been set.
int NAVIGATIONHIDDEN_NO Constant for navigationHidden, value corresponding to the navexposed resource qualifier.
int NAVIGATIONHIDDEN_UNDEFINED Constant for navigationHidden: a value indicating that no value has been set.
int NAVIGATIONHIDDEN_YES Constant for navigationHidden, value corresponding to the navhidden resource qualifier.
int NAVIGATION_DPAD Constant for navigation, value corresponding to the dpad resource qualifier.
int NAVIGATION_NONAV Constant for navigation, value corresponding to the nonav resource qualifier.
int NAVIGATION_TRACKBALL Constant for navigation, value corresponding to the trackball resource qualifier.
int NAVIGATION_UNDEFINED Constant for navigation: a value indicating that no value has been set.
int NAVIGATION_WHEEL Constant for navigation, value corresponding to the wheel resource qualifier.
int ORIENTATION_LANDSCAPE Constant for orientation, value corresponding to the land resource qualifier.
int ORIENTATION_PORTRAIT Constant for orientation, value corresponding to the port resource qualifier.
int ORIENTATION_SQUARE This constant is deprecated. Not currently supported or used.
int ORIENTATION_UNDEFINED Constant for orientation: a value indicating that no value has been set.
int SCREENLAYOUT_LONG_MASK Constant for screenLayout: bits that encode the aspect ratio.
int SCREENLAYOUT_LONG_NO Constant for screenLayout: a SCREENLAYOUT_LONG_MASK value that corresponds to the notlong resource qualifier.
int SCREENLAYOUT_LONG_UNDEFINED Constant for screenLayout: a SCREENLAYOUT_LONG_MASK value indicating that no size has been set.
int SCREENLAYOUT_LONG_YES Constant for screenLayout: a SCREENLAYOUT_LONG_MASK value that corresponds to the long resource qualifier.
int SCREENLAYOUT_SIZE_LARGE Constant for screenLayout: a SCREENLAYOUT_SIZE_MASK value indicating the screen is at least approximately 480x640 dp units, corresponds to the large resource qualifier.
int SCREENLAYOUT_SIZE_MASK Constant for screenLayout: bits that encode the size.
int SCREENLAYOUT_SIZE_NORMAL Constant for screenLayout: a SCREENLAYOUT_SIZE_MASK value indicating the screen is at least approximately 320x470 dp units, corresponds to the normal resource qualifier.
int SCREENLAYOUT_SIZE_SMALL Constant for screenLayout: a SCREENLAYOUT_SIZE_MASK value indicating the screen is at least approximately 320x426 dp units, corresponds to the small resource qualifier.
int SCREENLAYOUT_SIZE_UNDEFINED Constant for screenLayout: a SCREENLAYOUT_SIZE_MASK value indicating that no size has been set.
int SCREENLAYOUT_SIZE_XLARGE Constant for screenLayout: a SCREENLAYOUT_SIZE_MASK value indicating the screen is at least approximately 720x960 dp units, corresponds to the xlarge resource qualifier.
int SCREEN_HEIGHT_DP_UNDEFINED
int SCREEN_WIDTH_DP_UNDEFINED
int SMALLEST_SCREEN_WIDTH_DP_UNDEFINED
int TOUCHSCREEN_FINGER Constant for touchscreen, value corresponding to the finger resource qualifier.
int TOUCHSCREEN_NOTOUCH Constant for touchscreen, value corresponding to the notouch resource qualifier.
int TOUCHSCREEN_STYLUS This constant is deprecated. Not currently supported or used.
int TOUCHSCREEN_UNDEFINED Constant for touchscreen: a value indicating that no value has been set.
int UI_MODE_NIGHT_MASK Constant for uiMode: bits that encode the night mode.
int UI_MODE_NIGHT_NO Constant for uiMode: a UI_MODE_NIGHT_MASK value that corresponds to the notnight resource qualifier.
int UI_MODE_NIGHT_UNDEFINED Constant for uiMode: a UI_MODE_NIGHT_MASK value indicating that no mode type has been set.
int UI_MODE_NIGHT_YES Constant for uiMode: a UI_MODE_NIGHT_MASK value that corresponds to the night resource qualifier.
int UI_MODE_TYPE_APPLIANCE Constant for uiMode: a UI_MODE_TYPE_MASK value that corresponds to the appliance resource qualifier.
int UI_MODE_TYPE_CAR Constant for uiMode: a UI_MODE_TYPE_MASK value that corresponds to the car resource qualifier.
int UI_MODE_TYPE_DESK Constant for uiMode: a UI_MODE_TYPE_MASK value that corresponds to the desk resource qualifier.
int UI_MODE_TYPE_MASK Constant for uiMode: bits that encode the mode type.
int UI_MODE_TYPE_NORMAL Constant for uiMode: a UI_MODE_TYPE_MASK value that corresponds to no UI mode resource qualifier specified.
int UI_MODE_TYPE_TELEVISION Constant for uiMode: a UI_MODE_TYPE_MASK value that corresponds to the television resource qualifier.
int UI_MODE_TYPE_UNDEFINED Constant for uiMode: a UI_MODE_TYPE_MASK value indicating that no mode type has been set.
[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<Configuration> CREATOR
public float fontScale Current user preference for the scaling factor for fonts, relative to the base density scaling.
public int hardKeyboardHidden A flag indicating whether the hard keyboard has been hidden.
public int keyboard The kind of keyboard attached to the device.
public int keyboardHidden A flag indicating whether any keyboard is available.
public Locale locale Current user preference for the locale, corresponding to locale resource qualifier.
public int mcc IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
public int mnc IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
public int navigation The kind of navigation method available on the device.
public int navigationHidden A flag indicating whether any 5-way or DPAD navigation available.
public int orientation Overall orientation of the screen.
public int screenHeightDp The current height of the available screen space, in dp units, corresponding to screen height resource qualifier.
public int screenLayout Bit mask of overall layout of the screen.
public int screenWidthDp The current width of the available screen space, in dp units, corresponding to screen width resource qualifier.
public int smallestScreenWidthDp The smallest screen size an application will see in normal operation, corresponding to smallest screen width resource qualifier.
public int touchscreen The kind of touch screen attached to the device.
public int uiMode Bit mask of the ui mode.
Public Constructors
Configuration()
Construct an invalid Configuration. You must call setToDefaults() for this object to be valid.
Configuration(Configuration o)
Makes a deep copy suitable for modification.
Public Methods
int compareTo(Configuration that)
int describeContents()
Parcelable methods
int diff(Configuration delta)
Return a bit mask of the differences between this Configuration object and the given one.
boolean equals(Configuration that)
boolean equals(Object that)
Compares this instance with the specified object and indicates if they are equal.
int hashCode()
Returns an integer hash code for this object.
boolean isLayoutSizeAtLeast(int size)
Check if the Configuration's current screenLayout is at least the given size.
static boolean needNewResources(int configChanges, int interestingChanges)
Determine if a new resource needs to be loaded from the bit set of configuration changes returned by updateFrom(Configuration).
void readFromParcel(Parcel source)
void setTo(Configuration o)
void setToDefaults()
Set this object to the system defaults.
String toString()
Returns a string containing a concise, human-readable description of this object.
int updateFrom(Configuration delta)
Copy the fields from delta into this Configuration object, keeping track of which ones have changed.
void writeToParcel(Parcel dest, int flags)
Flatten this object in to a Parcel.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable
From interface java.lang.Comparable

Constants

public static final int HARDKEYBOARDHIDDEN_NO

Since: API Level 3

Constant for hardKeyboardHidden, value corresponding to the physical keyboard being exposed.

Constant Value: 1 (0x00000001)

public static final int HARDKEYBOARDHIDDEN_UNDEFINED

Since: API Level 3

Constant for hardKeyboardHidden: a value indicating that no value has been set.

Constant Value: 0 (0x00000000)

public static final int HARDKEYBOARDHIDDEN_YES

Since: API Level 3

Constant for hardKeyboardHidden, value corresponding to the physical keyboard being hidden.

Constant Value: 2 (0x00000002)

public static final int KEYBOARDHIDDEN_NO

Since: API Level 1

Constant for keyboardHidden, value corresponding to the keysexposed resource qualifier.

Constant Value: 1 (0x00000001)

public static final int KEYBOARDHIDDEN_UNDEFINED

Since: API Level 1

Constant for keyboardHidden: a value indicating that no value has been set.

Constant Value: 0 (0x00000000)

public static final int KEYBOARDHIDDEN_YES

Since: API Level 1

Constant for keyboardHidden, value corresponding to the keyshidden resource qualifier.

Constant Value: 2 (0x00000002)

public static final int KEYBOARD_12KEY

Since: API Level 1

Constant for keyboard, value corresponding to the 12key resource qualifier.

Constant Value: 3 (0x00000003)

public static final int KEYBOARD_NOKEYS

Since: API Level 1

Constant for keyboard, value corresponding to the nokeys resource qualifier.

Constant Value: 1 (0x00000001)

public static final int KEYBOARD_QWERTY

Since: API Level 1

Constant for keyboard, value corresponding to the qwerty resource qualifier.

Constant Value: 2 (0x00000002)

public static final int KEYBOARD_UNDEFINED

Since: API Level 1

Constant for keyboard: a value indicating that no value has been set.

Constant Value: 0 (0x00000000)

public static final int NAVIGATIONHIDDEN_NO

Since: API Level 5

Constant for navigationHidden, value corresponding to the navexposed resource qualifier.

Constant Value: 1 (0x00000001)

public static final int NAVIGATIONHIDDEN_UNDEFINED

Since: API Level 5

Constant for navigationHidden: a value indicating that no value has been set.

Constant Value: 0 (0x00000000)

public static final int NAVIGATIONHIDDEN_YES

Since: API Level 5

Constant for navigationHidden, value corresponding to the navhidden resource qualifier.

Constant Value: 2 (0x00000002)

public static final int NAVIGATION_DPAD

Since: API Level 1

Constant for navigation, value corresponding to the dpad resource qualifier.

Constant Value: 2 (0x00000002)

public static final int NAVIGATION_NONAV

Since: API Level 1

Constant for navigation, value corresponding to the nonav resource qualifier.

Constant Value: 1 (0x00000001)

public static final int NAVIGATION_TRACKBALL

Since: API Level 1

Constant for navigation, value corresponding to the trackball resource qualifier.

Constant Value: 3 (0x00000003)

public static final int NAVIGATION_UNDEFINED

Since: API Level 1

Constant for navigation: a value indicating that no value has been set.

Constant Value: 0 (0x00000000)

public static final int NAVIGATION_WHEEL

Since: API Level 1

Constant for navigation, value corresponding to the wheel resource qualifier.

Constant Value: 4 (0x00000004)

public static final int ORIENTATION_LANDSCAPE

Since: API Level 1

Constant for orientation, value corresponding to the land resource qualifier.

Constant Value: 2 (0x00000002)

public static final int ORIENTATION_PORTRAIT

Since: API Level 1

Constant for orientation, value corresponding to the port resource qualifier.

Constant Value: 1 (0x00000001)

public static final int ORIENTATION_SQUARE

Since: API Level 1

This constant is deprecated.
Not currently supported or used.

Constant Value: 3 (0x00000003)

public static final int ORIENTATION_UNDEFINED

Since: API Level 1

Constant for orientation: a value indicating that no value has been set.

Constant Value: 0 (0x00000000)

public static final int SCREENLAYOUT_LONG_MASK

Since: API Level 4

Constant for screenLayout: bits that encode the aspect ratio.

Constant Value: 48 (0x00000030)

public static final int SCREENLAYOUT_LONG_NO

Since: API Level 4

Constant for screenLayout: a SCREENLAYOUT_LONG_MASK value that corresponds to the notlong resource qualifier.

Constant Value: 16 (0x00000010)

public static final int SCREENLAYOUT_LONG_UNDEFINED

Since: API Level 4

Constant for screenLayout: a SCREENLAYOUT_LONG_MASK value indicating that no size has been set.

Constant Value: 0 (0x00000000)

public static final int SCREENLAYOUT_LONG_YES

Since: API Level 4

Constant for screenLayout: a SCREENLAYOUT_LONG_MASK value that corresponds to the long resource qualifier.

Constant Value: 32 (0x00000020)

public static final int SCREENLAYOUT_SIZE_LARGE

Since: API Level 4

Constant for screenLayout: a SCREENLAYOUT_SIZE_MASK value indicating the screen is at least approximately 480x640 dp units, corresponds to the large resource qualifier. See Supporting Multiple Screens for more information.

Constant Value: 3 (0x00000003)

public static final int SCREENLAYOUT_SIZE_MASK

Since: API Level 4

Constant for screenLayout: bits that encode the size.

Constant Value: 15 (0x0000000f)

public static final int SCREENLAYOUT_SIZE_NORMAL

Since: API Level 4

Constant for screenLayout: a SCREENLAYOUT_SIZE_MASK value indicating the screen is at least approximately 320x470 dp units, corresponds to the normal resource qualifier. See Supporting Multiple Screens for more information.

Constant Value: 2 (0x00000002)

public static final int SCREENLAYOUT_SIZE_SMALL

Since: API Level 4

Constant for screenLayout: a SCREENLAYOUT_SIZE_MASK value indicating the screen is at least approximately 320x426 dp units, corresponds to the small resource qualifier. See Supporting Multiple Screens for more information.

Constant Value: 1 (0x00000001)

public static final int SCREENLAYOUT_SIZE_UNDEFINED

Since: API Level 4

Constant for screenLayout: a SCREENLAYOUT_SIZE_MASK value indicating that no size has been set.

Constant Value: 0 (0x00000000)

public static final int SCREENLAYOUT_SIZE_XLARGE

Since: API Level 9

Constant for screenLayout: a SCREENLAYOUT_SIZE_MASK value indicating the screen is at least approximately 720x960 dp units, corresponds to the xlarge resource qualifier. See Supporting Multiple Screens for more information.

Constant Value: 4 (0x00000004)

public static final int SCREEN_HEIGHT_DP_UNDEFINED

Since: API Level 13

Constant Value: 0 (0x00000000)

public static final int SCREEN_WIDTH_DP_UNDEFINED

Since: API Level 13

Constant Value: 0 (0x00000000)

public static final int SMALLEST_SCREEN_WIDTH_DP_UNDEFINED

Since: API Level 13

Constant Value: 0 (0x00000000)

public static final int TOUCHSCREEN_FINGER

Since: API Level 1

Constant for touchscreen, value corresponding to the finger resource qualifier.

Constant Value: 3 (0x00000003)

public static final int TOUCHSCREEN_NOTOUCH

Since: API Level 1

Constant for touchscreen, value corresponding to the notouch resource qualifier.

Constant Value: 1 (0x00000001)

public static final int TOUCHSCREEN_STYLUS

Since: API Level 1

This constant is deprecated.
Not currently supported or used.

Constant Value: 2 (0x00000002)

public static final int TOUCHSCREEN_UNDEFINED

Since: API Level 1

Constant for touchscreen: a value indicating that no value has been set.

Constant Value: 0 (0x00000000)

public static final int UI_MODE_NIGHT_MASK

Since: API Level 8

Constant for uiMode: bits that encode the night mode.

Constant Value: 48 (0x00000030)

public static final int UI_MODE_NIGHT_NO

Since: API Level 8

Constant for uiMode: a UI_MODE_NIGHT_MASK value that corresponds to the notnight resource qualifier.

Constant Value: 16 (0x00000010)

public static final int UI_MODE_NIGHT_UNDEFINED

Since: API Level 8

Constant for uiMode: a UI_MODE_NIGHT_MASK value indicating that no mode type has been set.

Constant Value: 0 (0x00000000)

public static final int UI_MODE_NIGHT_YES

Since: API Level 8

Constant for uiMode: a UI_MODE_NIGHT_MASK value that corresponds to the night resource qualifier.

Constant Value: 32 (0x00000020)

public static final int UI_MODE_TYPE_APPLIANCE

Since: API Level 16

Constant for uiMode: a UI_MODE_TYPE_MASK value that corresponds to the appliance resource qualifier.

Constant Value: 5 (0x00000005)

public static final int UI_MODE_TYPE_CAR

Since: API Level 8

Constant for uiMode: a UI_MODE_TYPE_MASK value that corresponds to the car resource qualifier.

Constant Value: 3 (0x00000003)

public static final int UI_MODE_TYPE_DESK

Since: API Level 8

Constant for uiMode: a UI_MODE_TYPE_MASK value that corresponds to the desk resource qualifier.

Constant Value: 2 (0x00000002)

public static final int UI_MODE_TYPE_MASK

Since: API Level 8

Constant for uiMode: bits that encode the mode type.

Constant Value: 15 (0x0000000f)

public static final int UI_MODE_TYPE_NORMAL

Since: API Level 8

Constant for uiMode: a UI_MODE_TYPE_MASK value that corresponds to no UI mode resource qualifier specified.

Constant Value: 1 (0x00000001)

public static final int UI_MODE_TYPE_TELEVISION

Since: API Level 13

Constant for uiMode: a UI_MODE_TYPE_MASK value that corresponds to the television resource qualifier.

Constant Value: 4 (0x00000004)

public static final int UI_MODE_TYPE_UNDEFINED

Since: API Level 8

Constant for uiMode: a UI_MODE_TYPE_MASK value indicating that no mode type has been set.

Constant Value: 0 (0x00000000)

Fields

public static final Creator<Configuration> CREATOR

Since: API Level 1

public float fontScale

Since: API Level 1

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

public int hardKeyboardHidden

Since: API Level 3

A flag indicating whether the hard keyboard has been hidden. This will be set on a device with a mechanism to hide the keyboard from the user, when that mechanism is closed. One of: HARDKEYBOARDHIDDEN_NO, HARDKEYBOARDHIDDEN_YES.

public int keyboard

Since: API Level 1

The kind of keyboard attached to the device. One of: KEYBOARD_NOKEYS, KEYBOARD_QWERTY, KEYBOARD_12KEY.

public int keyboardHidden

Since: API Level 1

A flag indicating whether any keyboard is available. Unlike hardKeyboardHidden, this also takes into account a soft keyboard, so if the hard keyboard is hidden but there is soft keyboard available, it will be set to NO. Value is one of: KEYBOARDHIDDEN_NO, KEYBOARDHIDDEN_YES.

public Locale locale

Since: API Level 1

Current user preference for the locale, corresponding to locale resource qualifier.

public int mcc

Since: API Level 1

IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier. 0 if undefined.

public int mnc

Since: API Level 1

IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier. 0 if undefined.

public int navigation

Since: API Level 1

The kind of navigation method available on the device. One of: NAVIGATION_NONAV, NAVIGATION_DPAD, NAVIGATION_TRACKBALL, NAVIGATION_WHEEL.

public int navigationHidden

Since: API Level 5

A flag indicating whether any 5-way or DPAD navigation available. This will be set on a device with a mechanism to hide the navigation controls from the user, when that mechanism is closed. One of: NAVIGATIONHIDDEN_NO, NAVIGATIONHIDDEN_YES.

public int orientation

Since: API Level 1

Overall orientation of the screen. May be one of ORIENTATION_LANDSCAPE, ORIENTATION_PORTRAIT.

public int screenHeightDp

Since: API Level 13

The current height of the available screen space, in dp units, corresponding to screen height resource qualifier.

public int screenLayout

Since: API Level 4

Bit mask of overall layout of the screen. Currently there are two fields:

The SCREENLAYOUT_SIZE_MASK bits define the overall size of the screen. They may be one of SCREENLAYOUT_SIZE_SMALL, SCREENLAYOUT_SIZE_NORMAL, SCREENLAYOUT_SIZE_LARGE, or SCREENLAYOUT_SIZE_XLARGE.

The SCREENLAYOUT_LONG_MASK defines whether the screen is wider/taller than normal. They may be one of SCREENLAYOUT_LONG_NO or SCREENLAYOUT_LONG_YES.

See Supporting Multiple Screens for more information.

public int screenWidthDp

Since: API Level 13

The current width of the available screen space, in dp units, corresponding to screen width resource qualifier.

public int smallestScreenWidthDp

Since: API Level 13

The smallest screen size an application will see in normal operation, corresponding to smallest screen width resource qualifier. This is the smallest value of both screenWidthDp and screenHeightDp in both portrait and landscape.

public int touchscreen

Since: API Level 1

The kind of touch screen attached to the device. One of: TOUCHSCREEN_NOTOUCH, TOUCHSCREEN_FINGER.

public int uiMode

Since: API Level 8

Bit mask of the ui mode. Currently there are two fields:

The UI_MODE_TYPE_MASK bits define the overall ui mode of the device. They may be one of UI_MODE_TYPE_UNDEFINED, UI_MODE_TYPE_NORMAL, UI_MODE_TYPE_DESK, UI_MODE_TYPE_CAR, UI_MODE_TYPE_TELEVISION, or UI_MODE_TYPE_APPLIANCE.

The UI_MODE_NIGHT_MASK defines whether the screen is in a special mode. They may be one of UI_MODE_NIGHT_UNDEFINED, UI_MODE_NIGHT_NO or UI_MODE_NIGHT_YES.

Public Constructors

public Configuration ()

Since: API Level 1

Construct an invalid Configuration. You must call setToDefaults() for this object to be valid.

public Configuration (Configuration o)

Since: API Level 1

Makes a deep copy suitable for modification.

Public Methods

public int compareTo (Configuration that)

Since: API Level 1

public int describeContents ()

Since: API Level 1

Parcelable methods

Returns
  • a bitmask indicating the set of special object types marshalled by the Parcelable.

public boolean equals (Configuration that)

Since: API Level 1

public boolean equals (Object that)

Since: API Level 1

Compares this instance with the specified object and indicates if they are equal. In order to be equal, o must represent the same object as this instance using a class-specific comparison. The general contract is that this comparison should be reflexive, symmetric, and transitive. Also, no object reference other than null is equal to null.

The default implementation returns true only if this == o. See Writing a correct equals method if you intend implementing your own equals method.

The general contract for the equals and hashCode() methods is that if equals returns true for any two objects, then hashCode() must return the same value for these objects. This means that subclasses of Object usually override either both methods or neither of them.

Parameters
that the object to compare this instance with.
Returns
  • true if the specified object is equal to this Object; false otherwise.

public int hashCode ()

Since: API Level 1

Returns an integer hash code for this object. By contract, any two objects for which equals(Object) returns true must return the same hash code value. This means that subclasses of Object usually override both methods or neither method.

Note that hash values must not change over time unless information used in equals comparisons also changes.

See Writing a correct hashCode method if you intend implementing your own hashCode method.

Returns
  • this object's hash code.

public boolean isLayoutSizeAtLeast (int size)

Since: API Level 11

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

Returns
  • Returns true if the current screen layout size is at least the given size.

public static boolean needNewResources (int configChanges, int interestingChanges)

Since: API Level 1

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

Parameters
configChanges The mask of changes configurations as returned by updateFrom(Configuration).
interestingChanges The configuration changes that the resource can handled, as given in changingConfigurations.
Returns
  • Return true if the resource needs to be loaded, else false.

public void readFromParcel (Parcel source)

Since: API Level 8

public void setTo (Configuration o)

Since: API Level 8

public void setToDefaults ()

Since: API Level 1

Set this object to the system defaults.

public String toString ()

Since: API Level 1

Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:

   getClass().getName() + '@' + Integer.toHexString(hashCode())

See Writing a useful toString method if you intend implementing your own toString method.

Returns
  • a printable representation of this object.

public int updateFrom (Configuration delta)

Since: API Level 1

Copy the fields from delta into this Configuration object, keeping track of which ones have changed. Any undefined fields in delta are ignored and not copied in to the current Configuration.

Returns

public void writeToParcel (Parcel dest, int flags)

Since: API Level 1

Flatten this object in to a Parcel.

Parameters
dest The Parcel in which the object should be written.
flags Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.