Java tutorial
//package com.java2s; import android.view.View; import android.view.ViewGroup; public class Main { public static void removeFromSuperView(View view) { ViewGroup parent = (ViewGroup) view.getParent(); if (parent != null) parent.removeView(view); } }