Android URI Create makeUriString(Uri uri)

Here you can find the source of makeUriString(Uri uri)

Description

make Uri String

Declaration

private static String makeUriString(Uri uri) 

Method Source Code

//package com.java2s;

import android.net.Uri;
import android.text.TextUtils;

public class Main {
    private static String makeUriString(Uri uri) {
        StringBuilder stringbuilder = new StringBuilder();
        String s = uri.getScheme();
        if (s != null)
            stringbuilder.append(s).append(':');
        String s1 = uri.getEncodedAuthority();
        if (s1 != null)
            stringbuilder.append("//").append(s1);
        String s2 = Uri.encode(uri.getPath(), "/=");
        if (s2 != null)
            stringbuilder.append(s2);/*from w  ww.ja  v a2  s . c om*/
        String s3 = uri.getEncodedQuery();
        if (!TextUtils.isEmpty(s3))
            stringbuilder.append('?').append(s3);
        String s4 = uri.getEncodedFragment();
        if (!TextUtils.isEmpty(s4))
            stringbuilder.append('#').append(s4);
        return stringbuilder.toString();
    }
}

Related

  1. createUriFromString(String uriString)