how to set back button on toolbar in fragment android code example Example: android add back button to toolbar programmatically actionBar.setDisplayHomeAsUpEnabled(true);