Język

Uri Class

Definition

Immutable URI reference.

[Android.Runtime.Register("android/net/Uri", DoNotGenerateAcw=true)]
public abstract class Uri : Java.Lang.Object, Android.OS.IParcelable, IDisposable, Java.Lang.IComparable
[<Android.Runtime.Register("android/net/Uri", DoNotGenerateAcw=true)>]
type Uri = class
    inherit Object
    interface IParcelable
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
    interface IComparable
Inheritance
Attributes
Implements

Remarks

Immutable URI reference. A URI reference includes a URI and a fragment, the component of the URI following a '#'. Builds and parses URI references which conform to RFC 2396.

In the interest of performance, this class performs little to no validation. Behavior is undefined for invalid input. This class is very forgiving--in the face of invalid input, it will return garbage rather than throw an exception unless otherwise specified.

Java documentation for android.net.Uri.

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.

Constructors

Name Description
Uri(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Properties

Name Description
Authority

Gets the decoded authority part of this URI.

Class

Returns the runtime class of this Object.

(Inherited from Object)
Creator

Reads Uris from Parcels.

Empty

The empty URI, equivalent to "".

EncodedAuthority

Gets the encoded authority part of this URI.

EncodedFragment

Gets the encoded fragment part of this URI, everything after the '#'.

EncodedPath

Gets the encoded path.

EncodedQuery

Gets the encoded query component from this URI.

EncodedSchemeSpecificPart

Gets the scheme-specific part of this URI, i.e. everything between the scheme separator ':' and the fragment separator '#'.

EncodedUserInfo

Gets the encoded user information from the authority.

Fragment

Gets the decoded fragment part of this URI, everything after the '#'.

Handle

The handle to the underlying Android instance.

(Inherited from Object)
Host

Gets the encoded host from the authority for this URI.

IsAbsolute

Returns true if this URI is absolute, i.

IsHierarchical

Returns true if this URI is hierarchical like "http://google.com".

IsOpaque

Returns true if this URI is opaque; otherwise, false.

IsRelative

Returns true if this URI is relative, i.e. if it doesn't contain an explicit scheme.

JniIdentityHashCode

Gets the identity hash code assigned to this Java peer by the interop runtime.

(Inherited from Object)
JniManagedPeerState (Inherited from JavaObject)
JniPeerMembers

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

LastPathSegment

Gets the decoded last segment in the path.

Path

Gets the decoded path.

PathSegments

Gets the decoded path segments.

PeerReference

Gets the JNI object reference for this Java peer.

(Inherited from Object)
Port

Gets the port from the authority for this URI.

Query

Gets the decoded query component from this URI.

QueryParameterNames

Returns a set of the unique names of all query parameters.

Scheme

Gets the scheme of this URI.

SchemeSpecificPart

Gets the scheme-specific part of this URI, i.e. everything between the scheme separator ':' and the fragment separator '#'.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

UserInfo

Gets the decoded user information from the authority.

Methods

Name Description
BuildUpon()

Constructs a new builder, copying the attributes from this Uri.

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
CompareTo(Uri)

Compares the string representation of this Uri with that of another.

Construct(JniObjectReference, JniObjectReferenceOptions) (Inherited from JavaObject)
Decode(String)

Decodes '%'-escaped octets in the given string using the UTF-8 scheme.

DescribeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

Dispose()

Releases the resources held by this Java peer.

(Inherited from Object)
Dispose(Boolean)

Releases the resources held by this Java peer.

(Inherited from Object)
DisposeUnlessReferenced() (Inherited from JavaObject)
Encode(String, String)

Encodes characters in the given string as '%'-escaped octets using the UTF-8 scheme.

Encode(String)

Encodes characters in the given string as '%'-escaped octets using the UTF-8 scheme.

Equals(Object) (Inherited from JavaObject)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
FromFile(File)

Creates a Uri from a file.

FromParts(String, String, String)

Creates an opaque Uri from the given components.

GetBooleanQueryParameter(String, Boolean)

Searches the query string for the first value with the given key and interprets it as a boolean value.

GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetQueryParameter(String)

Searches the query string for the first value with the given key.

GetQueryParameters(String)

Searches the query string for parameter values with the given key.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
NormalizeScheme()

Return an equivalent URI with a lowercase scheme component.

Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
Parse(String)

Creates a Uri which parses the given encoded URI string.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetPeerReference(JniObjectReference, JniObjectReferenceOptions) (Inherited from JavaObject)
ToArray<T>()

Creates a managed array from this Java array wrapper.

(Inherited from Object)
ToString()

Returns the encoded string representation of this URI.

UnregisterFromRuntime()

Unregisters this Java peer from the interop runtime.

(Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
WithAppendedPath(Uri, String)

Creates a new Uri by appending an already-encoded path segment to a base Uri.

WriteToParcel(Parcel, ParcelableWriteFlags)

Flatten this object in to a Parcel.

WriteToParcel(Parcel, Uri)

Writes a Uri to a Parcel.

Explicit Interface Implementations

Name Description
IComparable.CompareTo(Object)
IJavaPeerable.Disposed() (Inherited from JavaObject)
IJavaPeerable.Finalized() (Inherited from JavaObject)
IJavaPeerable.JniObjectReferenceControlBlock (Inherited from JavaObject)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from JavaObject)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from JavaObject)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from JavaObject)
IJavaPeerable.UnregisterFromRuntime()

Extension Methods

Name Description
GetJniTypeName(IJavaPeerable)

Gets the JNI name of the type of the instance self.

JavaAs<TResult>(IJavaPeerable)

Try to coerce self to type TResult, checking that the coercion is valid on the Java side.

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
TryJavaCast<TResult>(IJavaPeerable, TResult)

Try to coerce self to type TResult, checking that the coercion is valid on the Java side.

Applies to