Open guoyoujin opened 9 years ago
What have you tried so far?
@kanytu
@Override public void onNavigationDrawerItemSelected(int position) { // Toast.makeText(this, "Menu item selected -> " + position, Toast.LENGTH_SHORT).show(); // mToolbar.setTitle("Menu item selected -> " + position); initFragmentTrans(); switch (position) { case 0: initNewsFragment(); mTitle = "NewsFragment"; mToolbar.setTitle(mTitle); break; case 1: initGoddessFragment(); mTitle = "Goddess"; mToolbar.setTitle(mTitle); break; case 2: initWeatherFragment(); mTitle = "Weather"; mToolbar.setTitle(mTitle); break; case 3: break; default:
}
You're not supposed to use mToolbar.setTitle
.
Call getSupportActionBar().setTitle
instead
@kanytu I'll try, because I use is mToolbar
ActionBar title can change, I tried to change, is not what I want effect