I have 4 tabs in my app. In which one is accessible without log-in but others can't be. So, I need to implement a functionality in which if a user clicks on that tab then rest 4 will be disabled and when I click on those tabs I only want toast but if I click on those tabs I get toast but it also got selected but fragment not changed. I want to disable that tab I have assigned a value to a variable to check whether it is without logging or after logging.
Code:
case R.id.home:
if(value.equals("1")){
Toast.makeText(CarerSeekerActivity.this,R.string.login_signup,Toast.LENGTH_SHORT).show();
navigation.getMenu().getItem(0).setEnabled(false);
}
else {
fragment = new CreatePersonalizedPackageCareSeekerFragment();
changeFragments(fragment);
}
return true;
but it is showing toast and but selected that tab. I do not want to make it selected. Please help.