BottomBar
BottomBar copied to clipboard
first tab does not always respond to click with onTabSelected
I can't understand what's happening here, basically the first case (tab) isn't triggered most of the time, by that I mean, it will guaranteed to work when I click on the other two tabs/cases !!?? I know it's ridiculous, but when the click on Email tab then on Home it will be triggered and it will replace the fragment normally.!?
I issue doesn't happen to the other two tabs.. just the first "home"..! the IDs is accurate btw.!
any help here?
@Override
public void onTabSelected(@IdRes int tabId) {
switch (tabId) {
case R.id.navigation_home:
HomeFragment homeFrag = new HomeFragment();
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.Container, homeFrag);
fragmentTransaction.commit();
break;
case R.id.navigation_email:
sendEmail(API_EndPoints.email);
break;
case R.id.navigation_phone:
dialContactPhone(API_EndPoints.phone);
break;
}
}