Java tutorial
//package com.java2s; import android.view.View; public class Main { public static int getViewMeasuredHeight(View view) { calcViewMeasure(view); return view.getMeasuredHeight(); } public static void calcViewMeasure(View view) { int width = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED); int expandSpec = View.MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, View.MeasureSpec.AT_MOST); view.measure(width, expandSpec); } }