public static void removeFromParent ( @ NonNull final View view ) { Condition . INSTANCE . ensureNotNull ( view , "The view may not be null" ) ; ViewParent parent = view . getParent ( ) ; if ( parent instanceof ViewGroup ) { ( ( ViewGroup ) parent ) . removeView ( view ) ; } }
Removes a specific view from its parent if there is any .