共用方式為


Preferences.NodeExists(String) Method

Definition

Returns true if the named preference node exists in the same tree as this node.

[Android.Runtime.Register("nodeExists", "(Ljava/lang/String;)Z", "GetNodeExists_Ljava_lang_String_Handler")]
public abstract bool NodeExists (string? pathName);
[<Android.Runtime.Register("nodeExists", "(Ljava/lang/String;)Z", "GetNodeExists_Ljava_lang_String_Handler")>]
abstract member NodeExists : string -> bool

Parameters

pathName
String

the path name of the node whose existence is to be checked.

Returns

true if the specified node exists.

Attributes

Exceptions

if this node has been removed and the path is not an empty string.

if the path name is invalid.

if the given path is null.

if the backing store is unavailable or causes an operation failure.

Remarks

Returns true if the named preference node exists in the same tree as this node. Relative path names (which do not begin with the slash character ('/')) are interpreted relative to this preference node.

If this node (or an ancestor) has already been removed with the #removeNode() method, it is legal to invoke this method, but only with the path name ""; the invocation will return false. Thus, the idiom p.nodeExists("") may be used to test whether p has been removed.

Java documentation for java.util.prefs.Preferences.nodeExists(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