CopyPastor

Detecting plagiarism made easy.

Score: 0.8315237164497375; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2019-10-24
by uzair iqbal

Original Post

Original - Posted on 2018-04-04
by Aks4125



            
Present in both answers; Present only in the new answer; Present only in the old answer;

try this
try(Realm realm = Realm.getDefaultInstance()) { realm.executeTransaction(new Realm.Transaction() { @Override public void execute(Realm realm) { RealmList<News> _newsList = new RealmList<>(); _newsList.addAll(myCustomArrayList); realm.insertOrUpdate(_newsList); // <-- insert unmanaged to Realm } }); }
In case if you're using @PrimaryKey then `insertOrUpdate` will do the trick
try(Realm realm = Realm.getDefaultInstance()) { realm.executeTransaction(new Realm.Transaction() { @Override public void execute(Realm realm) { RealmList<News> _newsList = new RealmList<>(); _newsList.addAll(myCustomArrayList); realm.insertOrUpdate(_newsList); // <-- insert unmanaged to Realm } }); }

        
Present in both answers; Present only in the new answer; Present only in the old answer;