Sdílet prostřednictvím


WebView.FindAddress(String) Method

Definition

Gets the first substring which appears to be the address of a physical location.

[Android.Runtime.Register("findAddress", "(Ljava/lang/String;)Ljava/lang/String;", "")]
public static string? FindAddress (string? addr);
[<Android.Runtime.Register("findAddress", "(Ljava/lang/String;)Ljava/lang/String;", "")>]
static member FindAddress : string -> string

Parameters

addr
String

the string to search for addresses

Returns

the address, or if no address is found, null

Attributes

Remarks

Gets the first substring which appears to be the address of a physical location. Only addresses in the United States can be detected, which must consist of: <ul> <li>a house number</li> <li>a street name</li> <li>a street type (Road, Circle, etc), either spelled out or abbreviated</li> <li>a city name</li> <li>a state or territory, either spelled out or two-letter abbr</li> <li>an optional 5 digit or 9 digit zip code</li> </ul> All names must be correctly capitalized, and the zip code, if present, must be valid for the state. The street type must be a standard USPS spelling or abbreviation. The state or territory must also be spelled or abbreviated using USPS standards. The house number may not exceed five digits.

<p class="note"><b>Note:</b> This function is deprecated and should be avoided on all API levels, as it cannot detect addresses outside of the United States and has a high rate of false positives. On API level android.os.Build.VERSION_CODES#O_MR1 and earlier, it also causes the entire WebView implementation to be loaded and initialized, which can throw android.util.AndroidRuntimeException or other exceptions if the WebView implementation is currently being updated.

This member is deprecated. This method is superseded by TextClassifier#generateLinks( android.view.textclassifier.TextLinks.Request). Avoid using this method even when targeting API levels where no alternative is available.

Java documentation for android.webkit.WebView.findAddress(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