Android examples for User Interface:ActionBar
Set the home button in ActionBar for returning to parent Activity
import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; public class Main{ /**//from ww w . j a v a 2 s .c o m * Set the home button in ActionBar for returning to parent Activity * * @param activity */ public static void setSupportActionBarHomeButton( AppCompatActivity activity) { ActionBar actionBar = activity.getSupportActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(true); } } }