Code example for ViewGroup

Methods: removeView

0
     * @param childIndex Index within the parent to insert at 
     */ 
    protected void addItemView(View itemView, int childIndex) {
        final ViewGroup currentParent = (ViewGroup) itemView.getParent();
        if (currentParent != null) {
            currentParent.removeView(itemView);
        } 
        ((ViewGroup) mMenuView).addView(itemView, childIndex);
    } 
 
    /** 
     * Filter the child view at index and remove it if appropriate. 
     * @param parent Parent to filter from 
     * @param childIndex Index to filter 
     * @return true if the child view at index was removed 
     */ 
    protected boolean filterLeftoverView(ViewGroup parent, int childIndex) {
        parent.removeViewAt(childIndex);
        return true; 
    }