I have fragment A, B, C, D. I want to hide the action bar in fragment D.
I tried getActivity().getActionBar().hide();and it didn't work.
public class Profile extends Fragment {
public Profile() {
}
public static Profile newInstance(int instance) {
Bundle args = new Bundle();
args.putInt("argsInstance", instance);
Profile profile = new Profile();
profile.setArguments(args);
return profile;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
getActivity().getActionBar().hide();
View profile = inflater.inflate(R.layout.fragment_profile, container, false);
return profile;
}
}
source
share