美文网首页
android.net.Uri类

android.net.Uri类

作者: acc8226 | 来源:发表于2017-02-22 14:32 被阅读287次

    Uri.Builder
    Helper class for building or manipulating URI references.

     Uri builtUri = Uri.parse(FORECAST_BASE_URL).buildUpon()
                            .appendQueryParameter(QUERY_PARAM, params[0])
                            .appendQueryParameter(FORMAT_PARAM, format)
                            .appendQueryParameter(UNITS_PARAM, units)
                            .appendQueryParameter(DAYS_PARAM, Integer.toString(numDays))
                            .appendQueryParameter(APPID_PARAM, BuildConfig.OPEN_WEATHER_MAP_API_KEY)
                            .build();
    URL url = new URL(builtUri.toString());
    

    相关文章

      网友评论

          本文标题:android.net.Uri类

          本文链接:https://www.haomeiwen.com/subject/glhmwttx.html