@James_Duh I spotted a post that is 6 years old that said this has been a problem I am not sure if Google has made a correction or not. Since you have a need to carry out some action on lets say Activity 3 You could add a TextView to the toolbar and tie a click listener to the text. Then you can style the text some color if the color is important. While this is not an exact answer to your question it is I hope a leaning alternative. Great question for a 7th grader Code below
This goes in the xml file associated with the Activity below the toolbar declation
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Add"
android:textStyle="bold"
android:textSize="22sp"/>
And this is the construct for the listener in the associated Activity
private void addListenerOnTextView() {
Toolbar tb = (Toolbar) findViewById( R.id.toolbar );
setSupportActionBar( tb );
tb.findViewById( R.id.title ).setOnClickListener( new View.OnClickListener() {
@Override
public void onClick(View v) {
System.out.println("Text Was Clicked");
}
} );
getSupportActionBar().setTitle( null );
}
Ok this goes in the xml file
<Button
android:text="NEW"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btnNew"
android:layout_marginLeft="260dp"/>
and this is the listener in the Activity
private void addListenerOnButtonNew() {
Toolbar tb = (Toolbar) findViewById( R.id.toolbar );
setSupportActionBar( tb );
tb.findViewById( R.id.btnNew ).setOnClickListener( new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent( Activity2.this, Activity3.class );
startActivity( intent );
}
} );
getSupportActionBar().setTitle( null );
}
In my comment SO striped the spaces here is what it should look like
setTitle(" Page Three ");