Code example for ActionBarActivity

Methods: onOptionsItemSelected

0
            case android.R.id.home:{
                onBackPressed(); 
                return true; 
            } 
            default: 
                return super.onOptionsItemSelected(item);
        } 
    } 
} 
Contextual code suggestions in your IDE  Get Codota for Java