Change the text of the toolbar to be different from the name of the application

3

How can I change the text of the toolbar of my application so that it is not the same as the name of the App? Something like Google Translate.

This is how you look for it (as a Translator):

This is how the name appears on the application's toolbar (like "Google Translator"):

Appears as "Google Translate"

    
asked by David Ramírez 12.09.2016 в 06:48
source

1 answer

6

You refer to the title in the Toolbar , to change this text, you can do it in the following way , using the getSupportActionBar().setTitle(...) method:

...//
        myToolbar = (Toolbar) findViewById(R.id.toolbar_actionbar);

        setSupportActionBar(myToolbar);

        getSupportActionBar().setTitle("Mi titulo.");
//...
    
answered by 12.09.2016 / 14:11
source