Code example for FrameLayout.LayoutParams

0
		int px = (large && fresh) ? 64 : 56;
		FrameLayout fl = new FrameLayout(ctx);
		fl.setMinimumWidth(dpToPx(ctx, px));
		ProgressBar pb = new ProgressBar(ctx);
		px = dpToPx(ctx, 32);
		fl.addView(pb, new LayoutParams(px, px, Gravity.CENTER));
		return fl;
	} 
 
	protected static final int CONTENT_VIEW_ID = 140584;
 
	public static void singleFragmentActivitySetContentView(Activity activity) {
		FrameLayout fl = new FrameLayout(activity);
		fl.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
				LayoutParams.FILL_PARENT));
		fl.setId(CONTENT_VIEW_ID);
		activity.setContentView(fl);
	} 
 
}