Java tutorial
//package com.java2s; //License from project: Open Source License import android.view.View; import android.view.ViewGroup; public class Main { public static View getContentView(View parent) { if (parent instanceof ViewGroup) { ViewGroup group = (ViewGroup) parent; for (int i = 0; i < group.getChildCount(); i++) { if (group.getChildAt(i) instanceof ViewGroup) { ViewGroup group2 = (ViewGroup) group.getChildAt(i); for (int j = 0; j < group2.getChildCount(); j++) { if (group2.getChildAt(j) instanceof ViewGroup) { return group2.getChildAt(j); } } } } } return parent; } }