Shared element activity transition on android 5

前端 未结 12 878
我寻月下人不归
我寻月下人不归 2021-01-30 13:20

I wanted to setup a shared element transition when going from one Activity to another.

The first Activity has a RecyclerView with items. When an item is clicked that it

12条回答
  •  天命终不由人
    2021-01-30 13:53

    Got same issue, and it caused by recycler view updating in background, the recycler view will recreate view when notifyItemChanged(int index), so the share view was recycled and it got crash when come back.

    My solution is call recyclerView.setItemAnimator(null);, and it will prevent recycler view from recreating view.

提交回复
热议问题