Java tutorial
//package com.java2s; import android.graphics.Point; import android.view.View; public class Main { public static Point measure(View view) { int w = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED); int h = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED); view.measure(w, h); int height = view.getMeasuredHeight(); int width = view.getMeasuredWidth(); return new Point(width, height); } }