I have my MainActivity inside which I have BottomNavigation which loads fragment with the following method
private boolean loadFragment(Fragment fragment) {
//switching fragment
if (fragment != null) {
getSupportFragmentManager()
.beginTransaction()
.replace(R.id.fragment_container, fragment)
.commit();
return true;
}
return false;
}
When I switch between them quickly my app crashes at various places, but when I go slowly one by one everything works fine
This is how my app structure looks like
I am using Reteofit
for API call
I already tried setuserVisibleHint
also check if my view rootView is created or not