java.lang.Object | |
↳ | android.content.res.Configuration |
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 dynamic device configuration (various types of input devices).
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creator<Configuration> | CREATOR | ||||||||||
int | HARDKEYBOARDHIDDEN_NO | ||||||||||
int | HARDKEYBOARDHIDDEN_UNDEFINED | ||||||||||
int | HARDKEYBOARDHIDDEN_YES | ||||||||||
int | KEYBOARDHIDDEN_NO | ||||||||||
int | KEYBOARDHIDDEN_UNDEFINED | ||||||||||
int | KEYBOARDHIDDEN_YES | ||||||||||
int | KEYBOARD_12KEY | ||||||||||
int | KEYBOARD_NOKEYS | ||||||||||
int | KEYBOARD_QWERTY | ||||||||||
int | KEYBOARD_UNDEFINED | ||||||||||
int | NAVIGATION_DPAD | ||||||||||
int | NAVIGATION_NONAV | ||||||||||
int | NAVIGATION_TRACKBALL | ||||||||||
int | NAVIGATION_UNDEFINED | ||||||||||
int | NAVIGATION_WHEEL | ||||||||||
int | ORIENTATION_LANDSCAPE | ||||||||||
int | ORIENTATION_PORTRAIT | ||||||||||
int | ORIENTATION_SQUARE | ||||||||||
int | ORIENTATION_UNDEFINED | ||||||||||
int | TOUCHSCREEN_FINGER | ||||||||||
int | TOUCHSCREEN_NOTOUCH | ||||||||||
int | TOUCHSCREEN_STYLUS | ||||||||||
int | TOUCHSCREEN_UNDEFINED |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
android.os.Parcelable
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
fontScale | Current user preference for the scaling factor for fonts, relative to the base density scaling. | ||||||||||
hardKeyboardHidden | A flag indicating whether the hard keyboard has been hidden. | ||||||||||
keyboard | The kind of keyboard attached to the device. | ||||||||||
keyboardHidden | A flag indicating whether any keyboard is available. | ||||||||||
locale | Current user preference for the locale. | ||||||||||
mcc | IMSI MCC (Mobile Country Code). | ||||||||||
mnc | IMSI MNC (Mobile Network Code). | ||||||||||
navigation | The kind of navigation method available on the device. | ||||||||||
orientation | Overall orientation of the screen. | ||||||||||
touchscreen | The kind of touch screen attached to the device. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Construct an invalid Configuration. You must call setToDefaults()
for this object to be valid.
| |||||||||||
Makes a deep copy suitable for modification.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parcelable methods
| |||||||||||
Return a bit mask of the differences between this Configuration
object and the given one.
| |||||||||||
Compares this instance with the specified object and indicates if they
are equal.
| |||||||||||
Returns an integer hash code for this object.
| |||||||||||
Determine if a new resource needs to be loaded from the bit set of
configuration changes returned by updateFrom(Configuration).
| |||||||||||
Set this object to the system defaults.
| |||||||||||
Returns a string containing a concise, human-readable description of this
object.
| |||||||||||
Copy the fields from delta into this Configuration object, keeping
track of which ones have changed.
| |||||||||||
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
|
Current user preference for the scaling factor for fonts, relative to the base density scaling.
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.
The kind of keyboard attached to the device. One of: KEYBOARD_QWERTY, KEYBOARD_12KEY.
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.
Current user preference for the locale.
IMSI MCC (Mobile Country Code). 0 if undefined.
IMSI MNC (Mobile Network Code). 0 if undefined.
The kind of navigation method available on the device. One of: NAVIGATION_DPAD, NAVIGATION_TRACKBALL, NAVIGATION_WHEEL.
Overall orientation of the screen. May be one of ORIENTATION_LANDSCAPE, ORIENTATION_PORTRAIT, or ORIENTATION_SQUARE.
The kind of touch screen attached to the device. One of: TOUCHSCREEN_NOTOUCH, TOUCHSCREEN_STYLUS, TOUCHSCREEN_FINGER.
Construct an invalid Configuration. You must call setToDefaults() for this object to be valid.
Makes a deep copy suitable for modification.
Parcelable methods
Return a bit mask of the differences between this Configuration object and the given one. Does not change the values of either. Any undefined fields in delta are ignored.
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 both transitive and reflexive.
The implementation in Object
returns true
only if o
is the exact same object as the receiver (using the == operator for
comparison). Subclasses often implement equals(Object)
so that
it takes into account the two object's types and states.
The general contract for the equals(Object)
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 none of them.
that | the object to compare this instance with. |
---|
true
if the specified object is equal to this Object
; false
otherwise.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.
Determine if a new resource needs to be loaded from the bit set of configuration changes returned by updateFrom(Configuration).
configChanges | The mask of changes configurations as returned by updateFrom(Configuration). |
---|---|
interestingChanges | The configuration changes that the resource can handled, as given in changingConfigurations. |
Set this object to the system defaults.
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 simply concatenates the class name, the '@' sign and a hexadecimal representation of the object's hashCode(), that is, it is equivalent to the following expression:
getClass().getName() + '@' + Integer.toHexString(hashCode())
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.
Flatten this object in to a Parcel.
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. |