how to change the Title in Navigation Drawer

Set it for all your fragment. This should do the work!!

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.id.your_fragment_layout, container,
            false);
    getActivity().setTitle("<your title>");

    return rootView;
}

try this:

@Override
public void onResume() {
    super.onResume();

    ((AppCompatActivity) getActivity()).getSupportActionBar().setTitle("Your Title");
}

Ok i found the problem, your answer was good and i really change the title each time from the fragment but in addition i need to disable this line:

getSupportActionBar().setTitle(mDrawerTitle);

from the onDrawerOpened and onDrawerClosed

Tags:

Android