I created an app with navigation drawer. I want to change the color of actionbar and default icon of drawer to be changed on selection of a particular navigation menu item and it should change to default values on selection of any other item.
My code
Fragment fragment;
if(fragment.toString().contains("HomeFragment")){
ab = ((BaseActivity)getApplicationContext()).getSupportActionBar();
ab.setHomeButtonEnabled(true);
ab.setDisplayHomeAsUpEnabled(true);
ab.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#FFFFFF")));
ab.setElevation(0);
ab.setDisplayHomeAsUpEnabled(true);
ab.setHomeAsUpIndicator(R.drawable.username);
}
I could change actionbar color and navigation drawer icon with the above code,but can't change to default color and icon on other navigation item selection.