Now that results.remove(0) is deprecated in realm, what is the best way to remove the realm element in an android application?
I have tried to delete particular element and I have used following code :
using result.deleteAllFromRealm();
it's delete all element but need to delete particular position.
RealmResults<PersonDetailsModel> results = myRealm.where(PersonDetailsModel.class).equalTo("id", personId).findAll();
myRealm.beginTransaction();
results.remove(0); // App crash
myRealm.commitTransaction();
But it's app crash on that line and I am getting this error :
java.lang.UnsupportedOperationException: This method is not supported by 'RealmResults' or 'OrderedRealmCollectionSnapshot'.
Suggest some way to solved this issue.