JavaSystem.SetProperty(String, String) Method

Definition

Sets the system property indicated by the specified key.

[Android.Runtime.Register("setProperty", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;", "")]
public static string? SetProperty (string key, string? value);
[<Android.Runtime.Register("setProperty", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;", "")>]
static member SetProperty : string * string -> string

Parameters

key
String

the name of the system property.

value
String

the value of the system property.

Returns

the previous value of the system property, or null if it did not have one.

Attributes

Remarks

Sets the system property indicated by the specified key.

First, if a security manager exists, its SecurityManager.checkPermission method is called with a PropertyPermission(key, "write") permission. This may result in a SecurityException being thrown. If no exception is thrown, the specified property is set to the given value.

Added in 1.2.

Java documentation for java.lang.System.setProperty(java.lang.String, java.lang.String).

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