次の方法で共有


Preferences.ImportPreferences(Stream) Method

Definition

Imports all of the preferences represented by the XML document on the specified input stream.

[Android.Runtime.Register("importPreferences", "(Ljava/io/InputStream;)V", "")]
public static void ImportPreferences (System.IO.Stream? is);
[<Android.Runtime.Register("importPreferences", "(Ljava/io/InputStream;)V", "")>]
static member ImportPreferences : System.IO.Stream -> unit

Parameters

is
Stream

the input stream from which to read the XML document.

Attributes

Exceptions

if the data read from the given input stream is not from a valid XML document.

if an error occurs while importing.

Remarks

Imports all of the preferences represented by the XML document on the specified input stream. The document may represent user preferences or system preferences. If it represents user preferences, the preferences will be imported into the calling user's preference tree (even if they originally came from a different user's preference tree). If any of the preferences described by the document inhabit preference nodes that do not exist, the nodes will be created.

The XML document must have the following DOCTYPE declaration:

{@code
<!DOCTYPE preferences SYSTEM "http://java.sun.com/dtd/preferences.dtd">
            }

(This method is designed for use in conjunction with #exportNode(OutputStream) and #exportSubtree(OutputStream).

This method is an exception to the general rule that the results of concurrently executing multiple methods in this class yields results equivalent to some serial execution. The method behaves as if implemented on top of the other public methods in this class, notably #node(String) and #put(String, String).

Java documentation for java.util.prefs.Preferences.importPreferences(java.io.InputStream).

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