我将 3 部分数据显示在其中RecyclerView:
storyListyukulListhomeList当我尝试仅显示storyList或中yukulList的homeList数据时RecyclerView,它有效。但是当我尝试显示多个数据时,例如:storyList && yukulListor storyList && yukulList && homeList,它会显示
java.lang.IndexOutOfBoundsException。
我尝试过添加notifyDataSetChanged(),但无法成功。
显示收藏夹列表.java
public class ShowFavouriteList extends AppCompatActivity implements AdapterFavList.FavListener {
private RecyclerView recyclerView;
private TextView noFavtsTV;
AppPreferences appPreferences;
private SearchView searchView;
private AdapterFavList yAdapterFavlist;
private AdapterFavList mAdapterFavlist;
private AdapterFavList tAdapterFavlist;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_show_favourite_list);
SwipeRefreshLayout pullToRefresh = findViewById(R.id.pullToRefresh);
pullToRefresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() …Run Code Online (Sandbox Code Playgroud)