共用方式為


Uri.NormalizeScheme Method

Definition

Return an equivalent URI with a lowercase scheme component.

[Android.Runtime.Register("normalizeScheme", "()Landroid/net/Uri;", "GetNormalizeSchemeHandler")]
public virtual Android.Net.Uri? NormalizeScheme ();
[<Android.Runtime.Register("normalizeScheme", "()Landroid/net/Uri;", "GetNormalizeSchemeHandler")>]
abstract member NormalizeScheme : unit -> Android.Net.Uri
override this.NormalizeScheme : unit -> Android.Net.Uri

Returns

Uri

normalized Uri (never null)

Attributes

Remarks

Return an equivalent URI with a lowercase scheme component. This aligns the Uri with Android best practices for intent filtering.

For example, "HTTP://www.android.com" becomes "http://www.android.com"

All URIs received from outside Android (such as user input, or external sources like Bluetooth, NFC, or the Internet) should be normalized before they are used to create an Intent.

<p class="note">This method does <em>not</em> validate bad URI's, or 'fix' poorly formatted URI's - so do not use it for input validation. A Uri will always be returned, even if the Uri is badly formatted to begin with and a scheme component cannot be found.

Java documentation for android.net.Uri.normalizeScheme().

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