好吧,这有点复杂,我有一个自定义的RecyclerView适配器,在OnBindViewHolder方法中,我想根据一些不同的变量从回收器视图中删除当前项目,但当我从ArrayList中删除项目并调用notifyDataSetChanged();时,我会得到:java.lang.IllegalStateException: Cannot call this method while RecyclerView is c
因此,我有一个recyclerView,当用户单击LikeButton时,项目/行将保存到Room DB "favorite_table“和UserFavorite活动中。当用户再次单击所选的LikeButton时,我希望从我的DB上的"favorite_table“和最喜欢的活动中删除该行。使用mAppRepository.deleteRow(favoriteModel); 不会删除单击的行/项。单击LikedButton时<e