I have a question, I hope you can help me, I have a graphical interface that works with a library that loads several fragments simultaneously more or less of this type, that is, it does not wait for the click event to load the "tabs"
this is the code with which it loads the fragments
@Override
public Fragment getItem(int position) {
switch (position % 7) {
case 0:
return new RecyclerViewFragment();
case 1:
return new RecyclerViewFragment2();
case 2:
return new RecyclerViewFragment3();
case 3:
return new RecyclerViewFragment4();
case 4:
return new RecyclerViewFragment5();
case 5:
return new RecyclerViewFragment6();
case 6:
return new RecyclerViewFragment7();
//case 1:
// return RecyclerViewFragment.newInstance();
//case 2:
// return WebViewFragment.newInstance();
default:
return new RecyclerViewFragment();
}
}
When executing it on a phone, it blocks me because said fragments that load have a large amount of "products in the recycler view" I wanted to know how to implement a condition (maybe the if -thread method) that allows you to load the "case2 only when you have finished case 1 and so on.
in advance thank you very much