@Override public void setTitle(CharSequence title) { mTitle = title; super.setTitle(title); getActionBar().setTitle(mTitle); }
@Override public void setTitle(int titleId) { mTitle = getString(titleId); super.setTitle(titleId); getActionBar().setTitle(titleId); }
/** * Will set the title in the hosting Activity's title. Will only set the title if the fragment is * hosted by the Activity's manager, and not inner one. */ public static void setActivityTitle(Fragment fragment, CharSequence title) { FragmentActivity activity = fragment.getActivity(); if (activity.getSupportFragmentManager() == fragment.getFragmentManager()) { activity.setTitle(title); } }