realm/realm-android-adapters

Adapter behavior when deleting entry in local db

Opened this issue · 0 comments

Hi ,i'm having an issue when i'm trying to delete an entry in realm db , the adapter does get notified (with animation which is nice ) , but the adapter behavior changes afterwards , items orders is not longer
the same (positions messed up), as i try to select one item i get an out of range exception , i tried to attach a change listener to the adapter dataset and then notify the observable (recyclerview) , it does work but animation no longer shows ,(i suppose the built-in function already does it which makes sense ) so i 'm forced to call notifyDataSetChanged() on my adapter data to get it work ..., I tried to override the getItemId method and call the setHasStableIds(true) but it dosent fit as i'm having a String ID as a primary key in my model , i also overidded the getItem method in case , but still having the same issue , i used TransactionAsync aswell but still the same . I want to keep animation showing when i delete an item , hopefully someone has an idea how to solve it , i'm kind of stuck to be honest .

Thanks in advance for help .