change top bar icon to back button in android studio code example Example: android add back button to toolbar programmatically actionBar.setDisplayHomeAsUpEnabled(true);