Why is the button back in the toolbar not working?

In ActionBar, when pressed, she did the same as the back button on the phone.

And then you press and nothing happens

    1 answer 1

    toolbar.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { onBackPressed(); } });