Android View Remove removeFromParent(View child)

Here you can find the source of removeFromParent(View child)

Description

remove From Parent

Declaration

public static View removeFromParent(View child) 

Method Source Code

//package com.java2s;

import android.view.View;

import android.view.ViewGroup;

public class Main {
    public static View removeFromParent(View child) {
        if (child != null) {
            View parent = (View) child.getParent();
            if (parent != null && parent instanceof ViewGroup) {
                ((ViewGroup) parent).removeView(child);
            }/*from  w  w w .  ja  va 2s .  co m*/
        }
        return child;
    }
}

Related

  1. removeCurItem(MenuItem item, int idx, ViewPager vp)
  2. removeHardwareAccelerationSupport(View v)
  3. removeSelfFromParent(View v)