Code example for TabWidget

Methods: setId

0
class DynamicTabHost extends TabHost {
 
	public DynamicTabHost(Context context) {
		super(context);
 
		TabWidget tabs = new TabWidget(super.getContext());
		tabs.setId(android.R.id.tabs);
		addView(tabs, new LayoutParams(LayoutParams.WRAP_CONTENT,
				LayoutParams.WRAP_CONTENT, Gravity.TOP));
 
		FrameLayout frame = new FrameLayout(super.getContext());
		frame.setId(android.R.id.tabcontent);
		FrameLayout.LayoutParams params = new LayoutParams(
				LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT,
				Gravity.BOTTOM);
		params.setMargins(0, 65, 0, 0);
		addView(frame, params);
 
		super.setup(); 
	}