Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. public void deleteCurrentTodoItem(final int position) {
  2. mRealm.executeTransaction(new Realm.Transaction() {
  3. @Override
  4. public void execute(Realm realm) {
  5. //needed appropriate action for db manipulation
  6. //I've used realmDb so, use next line if your using realmDb
  7. //and need to deleteItem from db
  8. //otherwise write your code to implement required functionality
  9. mRealmTodoList.deleteFromRealm(position);
  10. notifyDataSetChanged();
  11. notifyItemRemoved(position);
  12. //notifyItemChanged(position);
  13. notifyItemRangeChanged(position, mRealmTodoList.size());
  14. }
  15. });
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement