I am setting up my Toolbar in my main activity and trying to change the background color with different fragments. So basically, I am trying to access the Toolbar object inside fragment and set different background color. Few things which I have tried to do is :
Access toolbar like: ((ActionBarActivity)getActivity()).getSupportActionBar().setBackgroundColor(XXX);
But I am unable to access the setBackgroundColor function inside fragment. It is perfectly working inside the Main Activity.