Code example for RelativeLayout

Methods: removeAllViews

0
		super.postInvalidate(); 
		buildUI(); 
	} 
 
	private void buildUI() { 
		layBase.removeAllViews();
		int viewId = 300000;
		for (int i = 0; i < listPath.size(); i++) {
			TextView tv = new TextView(getContext());
			tv.setId(viewId);
			RelativeLayout.LayoutParams fllp = new RelativeLayout.LayoutParams(
					LinearLayout.LayoutParams.WRAP_CONTENT,
					LinearLayout.LayoutParams.MATCH_PARENT);
 
			if (viewId > 300000) {
				fllp.addRule(RelativeLayout.RIGHT_OF, viewId - 1);
			} 
			fllp.rightMargin = UIUtils.dipToPx(2);
			tv.setLayoutParams(fllp);
			tv.setGravity(Gravity.CENTER_VERTICAL);
			tv.setClickable(true);