Reputation: 31
My android app has a toolbar and I wan to change the title of it. I used toolbar.setTitle() but it is not working... Please help. What should I do? I tried getSupportActionBar().setTitle() but it doesn't work.
Upvotes: 1
Views: 164
Reputation: 1921
Use below code to set the title
Toolbar mActionBarToolbar = (Toolbar) findViewById(R.id.toolbar_actionbar);
setSupportActionBar(mActionBarToolbar);
getSupportActionBar().setTitle("My title");
Upvotes: 1