I currently have a recycler view which contains image view in grid layout. I have delete icon using which I can set the state of recycler view to delete mode. If delete icon is clicked recycler view items goes to delete mode which means checkbox appears on image view which if selected can be deleted or if back button is clicked recycler view restores to normal state where check box disappears.
My problem is when I am going to delete mode and then coming back to normal state using back key my recycler view blinks. It happens only when I repeat the process again and again i.e delete mode -> back button -> delete mode -> back button -> repeat -> it blinks.
I have implemented These two solutions>>
setHasStableIds(true)
((SimpleItemAnimator) myRecyclerView.getItemAnimator()).setSupportsChangeAnimations(false);