Example usage for android.webkit URLUtil stripAnchor

List of usage examples for android.webkit URLUtil stripAnchor

Introduction

In this page you can find the example usage for android.webkit URLUtil stripAnchor.

Prototype

public static String stripAnchor(String url) 

Source Link

Document

Strips the url of the anchor.

Usage

From source file:android.webkit.LoadListener.java

/**
 * Sets the current URL associated with this load.
 *//*w w  w  . j  av a  2s .co m*/
void setUrl(String url) {
    if (url != null) {
        if (URLUtil.isDataUrl(url)) {
            // Don't strip anchor as that is a valid part of the URL
            mUrl = url;
        } else {
            mUrl = URLUtil.stripAnchor(url);
        }
        mUri = null;
        if (URLUtil.isNetworkUrl(mUrl)) {
            try {
                mUri = new WebAddress(mUrl);
            } catch (ParseException e) {
                e.printStackTrace();
            }
        }
    }
}