Code example for RelativeLayout

Methods: getHeight, getLayoutParams, getMeasuredHeight, getMeasuredWidth, getWidth, layout, measure

0
	} 
 
	public static Bitmap loadBitmapFromView(RelativeLayout v) {
		Log.d(TAG,
				"--------------------------------------v.getHeight()=" 
						+ v.getHeight() + ",v.getWidth()=" + v.getWidth()
						+ "-----------------------"); 
		v.measure(MeasureSpec.makeMeasureSpec(v.getLayoutParams().width,
				MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(
				v.getLayoutParams().height, MeasureSpec.EXACTLY));
		v.layout(0, 0, v.getMeasuredWidth(), v.getMeasuredHeight());
		Bitmap b = Bitmap.createBitmap(v.getHeight(), v.getWidth(),
				Bitmap.Config.ARGB_8888);
		Canvas c = new Canvas(b);
		v.draw(c);
		return b;
	} 
} 
Contextual code suggestions in your IDE  Get Codota for Java