Android URL Relative Resolve resolveRelativeUri(Uri sourceUri, String relativeUri)

Here you can find the source of resolveRelativeUri(Uri sourceUri, String relativeUri)

Description

resolve Relative Uri

Declaration

public static Uri resolveRelativeUri(Uri sourceUri, String relativeUri)
            throws MalformedURLException 

Method Source Code

//package com.java2s;

import java.net.MalformedURLException;
import java.net.URL;

import android.net.Uri;

public class Main {
    public static Uri resolveRelativeUri(Uri sourceUri, String relativeUri)
            throws MalformedURLException {
        URL source = new URL(sourceUri.toString());
        URL absolute = new URL(source, relativeUri);
        return Uri.parse(absolute.toString());
    }/*from w w  w.  j  a  v a 2s  . c  o m*/
}