How can I make the back navigation button contain the activity title?
This is my code, and when I click back, it only clicks in the arrow.
I know how to provide back navigation. I would like to know how I can include the title in the button!
Toolbar toolbar = (Toolbar) findViewById(R.id.activity_alarms_toolbar);
toolbar.setTitle("Alarms");
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});