Code example for ActionBarActivity

Methods: onOptionsItemSelected

0
    public boolean onOptionsItemSelected(MenuItem item) {
        if (android.R.id.home == item.getItemId()) {
            finish(); 
            return true; 
        } 
        return super.onOptionsItemSelected(item);
    } 
 
}