Android examples for User Interface:View Parent
get Parent View
//package com.java2s; import android.view.View; import android.view.ViewGroup; import android.view.ViewParent; public class Main { public static <T extends ViewGroup> T getParent(View v) { ViewParent parent = v.getParent(); if (parent == null || !(parent instanceof ViewGroup)) return null; return (T) parent; }/*w ww . ja v a2 s. co m*/ }