Android examples for User Interface:View Parent
remove Parent View
//package com.java2s; import android.view.View; import android.view.ViewGroup; import android.view.ViewParent; public class Main { public static void removeParent(View v) { ViewParent parent = v.getParent(); if (parent instanceof ViewGroup) { ViewGroup group = (ViewGroup) parent; group.removeView(v);// w w w .j a va 2 s.co m } } }