I am making a small application to take control of a sticker album when I change to missing ones they appear in the fragment missing and they are updated when I select or deselect a number. The issue is that I have to reload the info between tags and it is encouraged when I reload the RecyclerView adapter and create all the elements. How can I improve this performance?
I use the following function to recreate the fragments when I change tabs but it is necessary because I update the base when I select an item and must refresh to see the changes between tabs,
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
//Fragment newFragment = new Fragment();
super.setUserVisibleHint(isVisibleToUser);
if (isVisibleToUser ) {
//getFragmentManager().beginTransaction().replace(R.id.recyclerFaltantes,newFragment).commit();
getFragmentManager().beginTransaction().detach(this).attach(this).commit();
}
}