Tell me when I execute this code:
for(int i = 0; i < response.body().size(); i++) { // Узнаем колличество постов ArrayList<PostModelORM> postORM = new ArrayList<>(); postORM.add(new PostModelORM( Integer.parseInt(response.body().get(i).getIdPost()), response.body().get(i).getGuid().getRendered(), response.body().get(i).getDate(), response.body().get(i).getTitle().getRendered(), response.body().get(i).getContent().getRendered(), response.body().get(i).getExcerpt().getRendered(), response.body().get(i).getCategroiesMass())); SugarRecord.saveInTx(postORM);} When you call the cycle again, will the data be added or overwritten by new ones?
For the console gives me that they are added with each call of the cycle
I / Sugar: PostModelORM saved: 381 I / Sugar: PostModelORM saved: 382 I / Sugar: PostModelORM saved: 383 I / Sugar: PostModelORM saved: 384
How can you make it so that when you call the cycle again, the data is deleted and new ones are recorded so that later the database will not turn into a zoo