gpt4 book ai didi

android - android 中的 URISyntaxException

转载 作者:行者123 更新时间:2023-11-29 17:57:19 26 4
gpt4 key购买 nike

你好,我正在编写一个从服务器获取文章的 android 应用程序,我的问题是当我构建 URL 时,我得到一个未处理的异常类型 URISyntaxException 她是我的代码

public class ArticleActivity extends ListActivity {

protected static Resources resources;
// url to make request
private static URI url = new URI("http://"
+ resources.getString(R.string.SERVER_IP) + ":"
+ resources.getString(R.string.SERVER_PORT)
+ "/qareeboon/requests11/getArticleDetails?uuid="
+ Session.SESSION_UUID);

最佳答案

你可以为 uri 使用以下语法

Uri myUri = Uri.parse("http://stackoverflow.com")

关于android - android 中的 URISyntaxException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18460306/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com