Code example for FragmentActivity

Methods: finish, onOptionsItemSelected

0
 
    @Override 
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case android.R.id.home:
                finish(); 
        } 
        return super.onOptionsItemSelected(item);
    } 
 
}