Building on Jared's answer, I had to enable and implement the action bar back button behavior in several activities and created this helper class to reduce code duplication.
public final class ActionBarHelper {
public static void enableBackButton(AppCompatActivity context) {
if(context == null) return;
ActionBar actionBar = context.getSupportActionBar();
if (actionBar == null) return;
actionBar.setDisplayHomeAsUpEnabled(true);
}
}
Usage in an activity:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
...
ActionBarHelper.enableBackButton(this);
}