我有类似的字符串
String stringUrl = ["url1", "url2", "url3"];
现在我删除了方括号
String urls = stringUrl.replace("[","").replace("]","");
现在我劈伤了
String[] urlsArray = urls.split(",");
现在我写此代码
for (String url : urlsArray) {
holder.recyclerViewHomeWorkImages.setVisibility(View.VISIBLE);
holder.imgButtonDownload.setVisibility(View.VISIBLE);
imagesList.add(new ImageHomeworkModel(url, "Name"));
}
现在在图像家庭作业适配器我写这个
ImageHomeworkModel product = imagesList.get(position);
Picasso.with(context).load(product.getUrls()).into(holder.imgSetData);
现在的问题是毕加索仅加载拆分字符串的第一个网址,请帮助我快速找到解决方案
然后尝试一下
String URL = "";
for (String url : urlsArray) {
holder.recyclerViewHomeWorkImages.setVisibility(View.VISIBLE);
holder.imgButtonDownload.setVisibility(View.VISIBLE);
URL = URL + URL;
}
// Here you will have all your URL in one variable (i.e URL).
imagesList.add(new ImageHomeworkModel(URL, "Name"));