Last active
July 6, 2019 18:36
-
-
Save shubhamnikam/4703d95e83b4397c12e91689964d7f6d to your computer and use it in GitHub Desktop.
RecyclerView Adapter Swipe Right/Left
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void deleteCurrentTodoItem(final int position) { | |
mRealm.executeTransaction(new Realm.Transaction() { | |
@Override | |
public void execute(Realm realm) { | |
//needed appropriate action for db manipulation | |
//I've used realmDb so, use next line if your using realmDb | |
//and need to deleteItem from db | |
//otherwise write your code to implement required functionality | |
mRealmTodoList.deleteFromRealm(position); | |
notifyDataSetChanged(); | |
notifyItemRemoved(position); | |
//notifyItemChanged(position); | |
notifyItemRangeChanged(position, mRealmTodoList.size()); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment