Uri.Builder与String互转

Uri.Builder -> String
Uri.Builder builder = new Uri.Builder();
builder.encodedPath("http://xxx.xxx.xxx.xxx:xxxx");
builder.appendEncodedPath("xxx/xxx/xxx");
builder.appendQueryParameter("key", "value");

String url = builder.toString();

String -> Uri.Builder
Uri.Builder builder = Uri.parse(url).buildUpon();

你可能感兴趣的:(builder)