我有一段时间有问题,我需要在将数据存储到数据库之前更改来自JSON的数据。我做了一些工作,但我找到了最后一个元素,其他元素被覆盖了,我怎样才能获得所有数据。
public void setImage(String image) {
ListUrl listUrl=new ListUrl();
this.image = image;
if (!image.isEmpty()) {
try {
String paths= listUrl.Download_images(image);
if (!paths.isEmpty()) {
illustration = new Illustration(image, paths, "", "", true);
illustration.setPath(paths);
illustration.setLink(image);
illustration.setDownloaded(true);
setIllustration(illustration);
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
listUrl获取正常工作的图像路径所以我不知道问题在哪里
public class Illustration extends RealmObject {
@PrimaryKey
private int id;
private String link;
private String path;
private String fullLink;
private String fullPath;
private int originalHeight;
private int originalWidth;
private boolean downloaded;
// getter and setter