Code example for ActionBarActivity

Methods: onOptionsItemSelected

0
            case android.R.id.home:{
                onBackPressed(); 
                return true; 
            } 
            default: 
                return super.onOptionsItemSelected(item);
        } 
    } 
    // method to add parent Items 
    public void setGroupParents() 
    { 
        parentItems.add("Fruits");
        parentItems.add("Flowers");
        parentItems.add("Animals");
        parentItems.add("Birds");
    } 
 
    // method to set child data of each parent 
    public void setChildData() 
    {