Here you can find the source of removeFromParent(View child)
public static View removeFromParent(View child)
//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; } }