Sdílet prostřednictvím


Locale.Default Property

Definition

Gets the current value of the default locale for this instance of the Java Virtual Machine. -or- Sets the default locale for this instance of the Java Virtual Machine.

public static Java.Util.Locale Default { [Android.Runtime.Register("getDefault", "()Ljava/util/Locale;", "")] get; [Android.Runtime.Register("setDefault", "(Ljava/util/Locale;)V", "")] set; }
[<get: Android.Runtime.Register("getDefault", "()Ljava/util/Locale;", "")>]
[<set: Android.Runtime.Register("setDefault", "(Ljava/util/Locale;)V", "")>]
static member Default : Java.Util.Locale with get, set

Property Value

the default locale for this instance of the Java Virtual Machine

Attributes

Remarks

Property getter documentation:

Gets the current value of the default locale for this instance of the Java Virtual Machine.

The Java Virtual Machine sets the default locale during startup based on the host environment. It is used by many locale-sensitive methods if no locale is explicitly specified. It can be changed using the #setDefault(java.util.Locale) setDefault method.

Java documentation for java.util.Locale.getDefault().

Property setter documentation:

Sets the default locale for this instance of the Java Virtual Machine. This does not affect the host locale.

If there is a security manager, its checkPermission method is called with a PropertyPermission("user.language", "write") permission before the default locale is changed.

The Java Virtual Machine sets the default locale during startup based on the host environment. It is used by many locale-sensitive methods if no locale is explicitly specified.

Since changing the default locale may affect many different areas of functionality, this method should only be used if the caller is prepared to reinitialize locale-sensitive code running within the same Java Virtual Machine.

By setting the default locale with this method, all of the default locales for each Category are also set to the specified default locale.

Java documentation for java.util.Locale.setDefault(java.util.Locale).

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.

Applies to