RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT); titleparams.addRule(RelativeLayout.ALIGN_PARENT_TOP); titleparams.addRule(RelativeLayout.ALIGN_PARENT_LEFT); final TextView title = new TextView(getContext()); title.setText(getTitle()); title.setTextSize(24); title.setTextColor(Color.WHITE); title.setTypeface(Typeface.DEFAULT, Typeface.NORMAL); title.setGravity(Gravity.LEFT); title.setLayoutParams(titleparams); title.setId(TITLE_ID); //setup description final RelativeLayout.LayoutParams descriptionparams = new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT); descriptionparams.addRule(RelativeLayout.BELOW, title.getId()); // descriptionparams.addRule(RelativeLayout.LEFT_OF, CHECKBOX_ID); descriptionparams.addRule(RelativeLayout.ALIGN_PARENT_LEFT); description = new TextView(getContext()); description.setText(summaryOff);